debug-window: prevent using the store when disposing
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 3 Feb 2014 18:02:12 +0000 (19:02 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 5 Feb 2014 12:54:06 +0000 (13:54 +0100)
Using g_signal_connect_object() isn't enought as it prevents from calling the
callback when the windows has been destroyed but not while disposing it.

https://bugzilla.gnome.org/show_bug.cgi?id=692793

src/empathy-debug-window.c

index b56fe3c..b4392c3 100644 (file)
@@ -323,11 +323,16 @@ proxy_invalidated_cb (TpProxy *proxy,
     gpointer user_data)
 {
   EmpathyDebugWindow *self = (EmpathyDebugWindow *) user_data;
-  GtkTreeModel *service_store = GTK_TREE_MODEL (self->priv->service_store);
+  GtkTreeModel *service_store;
   TpProxy *stored_proxy;
   GtkTreeIter iter;
   gboolean valid_iter;
 
+  if (self->priv->service_store == NULL)
+    return;
+
+  service_store = GTK_TREE_MODEL (self->priv->service_store);
+
   /* Proxy has been invalidated so we find and set it to NULL
    * in service store */
   gtk_tree_model_get_iter_first (service_store, &iter);