summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-11 17:25:33 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-26 18:20:57 +0000
commitddc673b744983f80c44dee42f8dd7025d7b7fa69 (patch)
tree6411de685deaf204e65eec2dd3ea4e596fd7fa11
parent5b7390a2403bb2b37ebcbfc2cab27c8d766b6c17 (diff)
Replace dbus_g_method_get_sender with g_dbus_method_invocation_get_sender
It doesn't copy the string, unlike dbus_g_method_get_sender.
-rw-r--r--telepathy-glib/base-channel.c3
-rw-r--r--telepathy-glib/base-connection.c10
-rw-r--r--telepathy-glib/message-mixin.c3
3 files changed, 6 insertions, 10 deletions
diff --git a/telepathy-glib/base-channel.c b/telepathy-glib/base-channel.c
index 4bf686612..e14545e79 100644
--- a/telepathy-glib/base-channel.c
+++ b/telepathy-glib/base-channel.c
@@ -1072,10 +1072,9 @@ tp_base_channel_close_dbus (
if (DEBUGGING)
{
- gchar *caller = dbus_g_method_get_sender (context);
+ const gchar *caller = g_dbus_method_invocation_get_sender (context);
DEBUG ("called by %s", caller);
- g_free (caller);
}
tp_base_channel_close (chan);
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index c0d3ad8e0..f932db06f 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -2203,7 +2203,7 @@ tp_base_connection_dbus_add_client_interest (TpSvcConnection *svc,
GDBusMethodInvocation *context)
{
TpBaseConnection *self = (TpBaseConnection *) svc;
- gchar *unique_name = NULL;
+ const gchar *unique_name = NULL;
g_return_if_fail (TP_IS_BASE_CONNECTION (self));
g_return_if_fail (self->priv->bus_proxy != NULL);
@@ -2211,14 +2211,13 @@ tp_base_connection_dbus_add_client_interest (TpSvcConnection *svc,
if (interests == NULL || interests[0] == NULL)
goto finally;
- unique_name = dbus_g_method_get_sender (context);
+ unique_name = g_dbus_method_invocation_get_sender (context);
tp_base_connection_add_client_interest_impl (self, unique_name,
(const gchar * const *) interests, FALSE);
finally:
tp_svc_connection_return_from_add_client_interest (context);
- g_free (unique_name);
}
static void
@@ -2226,7 +2225,7 @@ tp_base_connection_dbus_remove_client_interest (TpSvcConnection *svc,
const gchar **interests,
GDBusMethodInvocation *context)
{
- gchar *unique_name = NULL;
+ const gchar *unique_name = NULL;
const gchar **interest;
TpBaseConnection *self = (TpBaseConnection *) svc;
gpointer name_in_hash, count_p;
@@ -2238,7 +2237,7 @@ tp_base_connection_dbus_remove_client_interest (TpSvcConnection *svc,
if (interests == NULL || interests[0] == NULL)
goto finally;
- unique_name = dbus_g_method_get_sender (context);
+ unique_name = g_dbus_method_invocation_get_sender (context);
/* this method isn't really meant to fail, so we might as well return now */
@@ -2321,7 +2320,6 @@ tp_base_connection_dbus_remove_client_interest (TpSvcConnection *svc,
finally:
tp_svc_connection_return_from_remove_client_interest (context);
- g_free (unique_name);
}
/* The handling of calls to Connection.Interface.Requests.CreateChannel is
diff --git a/telepathy-glib/message-mixin.c b/telepathy-glib/message-mixin.c
index 9d9f5c516..92ba0d88a 100644
--- a/telepathy-glib/message-mixin.c
+++ b/telepathy-glib/message-mixin.c
@@ -550,11 +550,10 @@ tp_message_mixin_acknowledge_pending_messages_async (
if (tp_intset_is_member (seen, id))
{
- gchar *client = dbus_g_method_get_sender (context);
+ const gchar *client = g_dbus_method_invocation_get_sender (context);
DEBUG ("%s passed message id %u more than once in one call to "
"AcknowledgePendingMessages. Foolish pup.", client, id);
- g_free (client);
continue;
}