From 462a95d857b1350eb6af8df31df1f9ddae32a79c Mon Sep 17 00:00:00 2001 From: frederic heem Date: Mon, 30 Oct 2006 15:20:12 +0100 Subject: [PATCH] dbus_g_method_get_sender return const char* --- dbus/dbus-glib-lowlevel.h | 2 +- dbus/dbus-gobject.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dbus/dbus-glib-lowlevel.h b/dbus/dbus-glib-lowlevel.h index cb015cc..289e716 100644 --- a/dbus/dbus-glib-lowlevel.h +++ b/dbus/dbus-glib-lowlevel.h @@ -57,7 +57,7 @@ DBusMessage* dbus_g_message_get_mess * g-functions anyhow) */ -gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context); +const gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context); DBusMessage* dbus_g_method_get_reply (DBusGMethodInvocation *context); diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index b51bc7c..d7cf7c4 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1967,17 +1967,13 @@ dbus_g_object_register_marshaller_array * * Returns: the unique name of teh sender */ -gchar * +const gchar * dbus_g_method_get_sender (DBusGMethodInvocation *context) { const gchar *sender; - sender = dbus_message_get_sender (dbus_g_message_get_message (context->message)); - - if (sender == NULL) - return NULL; - - return strdup (sender); + sender = (const gchar *)dbus_message_get_sender (dbus_g_message_get_message (context->message)); + return sender; } /** -- 1.4.2.4