[Telepathy-commits] [telepathy-glib/master] RequestChannel: don't leak a hash table if a ChannelManager claims the request

Will Thompson will.thompson at collabora.co.uk
Mon Sep 15 08:58:15 PDT 2008


---
 telepathy-glib/base-connection.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 3d310de..08e8616 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -1796,6 +1796,7 @@ tp_base_connection_request_channel (TpSvcConnection *iface,
   ChannelRequest *request;
   GHashTable *request_properties;
   GValue *v;
+  gboolean claimed_by_channel_manager = FALSE;
 
   g_assert (TP_IS_BASE_CONNECTION (self));
 
@@ -1833,11 +1834,17 @@ tp_base_connection_request_channel (TpSvcConnection *iface,
 
       if (tp_channel_manager_request_channel (manager, request,
             request_properties))
-        return;
+        {
+          claimed_by_channel_manager = TRUE;
+          break;
+        }
     }
 
   g_hash_table_destroy (request_properties);
 
+  if (claimed_by_channel_manager)
+    return;
+
   /* OK, none of them wanted it. Now try the channel factories */
 
   for (i = 0; i < priv->channel_factories->len; i++)
-- 
1.5.6.5




More information about the Telepathy-commits mailing list