[empathy] debug-window: fix leak on all TpDebugClient



commit e4d1698671dfede8f2ffae8f639d223c1c9c3959
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Feb 3 18:29:41 2014 +0100

    debug-window: fix leak on all TpDebugClient
    
    The store keeps its own ref and the client is reffed while the async call so
    we can unref it right away.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692793

 src/empathy-debug-window.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index 0fbf9f6..39d9f3e 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -392,9 +392,6 @@ debug_window_get_messages_cb (GObject *object,
        * selected service is unable to fetch debug messages */
       if (!tp_strdiff (active_service_name, proxy_service_name))
         debug_window_set_toolbar_sensitivity (self, FALSE);
-
-      /* We created the proxy for GetMessages call. Now destroy it. */
-      tp_clear_object (&debug);
       return;
     }
 
@@ -415,6 +412,8 @@ debug_window_get_messages_cb (GObject *object,
       DEBUG ("Proxy for service: %s was successful in fetching debug"
           " messages. Saving it.", proxy_service_name);
 
+      /* The store will take its own ref on the proxy preventing it to be
+       * destroyed when leaving this callback. */
       gtk_list_store_set (self->priv->service_store, &iter,
           COL_PROXY, debug,
           -1);
@@ -499,6 +498,8 @@ create_proxy_to_get_messages (EmpathyDebugWindow *self,
   tp_debug_client_get_messages_async (TP_DEBUG_CLIENT (new_proxy),
       debug_window_get_messages_cb, self);
 
+  g_object_unref (new_proxy);
+
 finally:
   g_free (name);
   tp_clear_object (&stored_proxy);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]