diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-07-20 11:51:38 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-07-20 14:28:38 +0100 |
commit | a30524b98da9403099dc303602b432d1b384237e (patch) | |
tree | 6ec1010637f74169b2823dd02fa474994a741090 | |
parent | 7b0ebf426f26d9790217f5b14808e2ace1f15de9 (diff) |
mcd_dispatcher_dup_possible_handlers: only take one TpChannel
https://bugs.freedesktop.org/show_bug.cgi?id=52305
-rw-r--r-- | src/mcd-dispatcher.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c index 9c170505..1807f202 100644 --- a/src/mcd-dispatcher.c +++ b/src/mcd-dispatcher.c @@ -178,9 +178,10 @@ mcd_dispatcher_dup_internal_handlers (void) static GStrv mcd_dispatcher_dup_possible_handlers (McdDispatcher *self, McdRequest *request, - const GList *channels, + TpChannel *channel, const gchar *must_have_unique_name) { + GList *channels = g_list_prepend (NULL, channel); GList *handlers = _mcd_client_registry_list_possible_handlers ( self->priv->clients, request != NULL ? _mcd_request_get_preferred_handler (request) : NULL, @@ -191,6 +192,8 @@ mcd_dispatcher_dup_possible_handlers (McdDispatcher *self, GStrv ret; const GList *iter; + g_list_free (channels); + if (handlers == NULL) return NULL; @@ -939,7 +942,6 @@ _mcd_dispatcher_add_channel (McdDispatcher *dispatcher, { GList *channels = NULL; TpChannel *tp_channel = NULL; - GList *tp_channels = NULL; GStrv possible_handlers; McdRequest *request = NULL; gboolean internal_request = FALSE; @@ -970,7 +972,6 @@ _mcd_dispatcher_add_channel (McdDispatcher *dispatcher, * It might also have the McdRequest part. */ tp_channel = mcd_channel_get_tp_channel (channel); g_assert (tp_channel != NULL); - tp_channels = g_list_prepend (NULL, g_object_ref (tp_channel)); request = _mcd_channel_get_request (channel); internal_request = _mcd_request_is_internal (request); @@ -981,12 +982,9 @@ _mcd_dispatcher_add_channel (McdDispatcher *dispatcher, else possible_handlers = mcd_dispatcher_dup_possible_handlers (dispatcher, request, - tp_channels, + tp_channel, NULL); - g_list_foreach (tp_channels, (GFunc) g_object_unref, NULL); - g_list_free (tp_channels); - if (possible_handlers == NULL) { DEBUG ("Channel cannot be handled - making a CDO " @@ -2091,16 +2089,11 @@ add_possible_handlers (McdDispatcher *self, const gchar *sender, const gchar *preferred_handler) { - GList *channels = NULL; GStrv possible_handlers; guint i; - channels = g_list_prepend (channels, tp_channel); - possible_handlers = mcd_dispatcher_dup_possible_handlers (self, - NULL, channels, NULL); - - g_list_free (channels); + NULL, tp_channel, NULL); for (i = 0; possible_handlers[i] != NULL; i++) { |