[telepathy-mission-control/master] McdDispatchOperation: don't leak lost channels if they have not been signalled at dispose time

Simon McVittie simon.mcvittie at collabora.co.uk
Thu May 28 04:24:18 PDT 2009


This shouldn't ever happen, though.
---
 src/mcd-dispatch-operation.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 226fe53..faac484 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -436,6 +436,16 @@ mcd_dispatch_operation_dispose (GObject *object)
         priv->channels = NULL;
     }
 
+    if (priv->lost_channels != NULL)
+    {
+        g_warning ("%s still has unsignalled lost channels at dispose time",
+                   priv->unique_name);
+        for (list = priv->lost_channels; list != NULL; list = list->next)
+            g_object_unref (list->data);
+        g_list_free (priv->lost_channels);
+        priv->lost_channels = NULL;
+    }
+
     if (priv->connection)
     {
         g_object_unref (priv->connection);
-- 
1.5.6.5




More information about the telepathy-commits mailing list