]> git.0d.be Git - empathy.git/commitdiff
contact_list_store_remove_contact: ensure that the store stays alive during the process
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 9 Sep 2011 10:49:46 +0000 (12:49 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 9 Sep 2011 10:57:07 +0000 (12:57 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=658644

libempathy-gtk/empathy-contact-list-store.c

index 189df5dc5bd2c6f71059ec4709e5993158221a83..fb15840e902af1c17a2e5470b47df9bb48fb23a4 100644 (file)
@@ -1132,6 +1132,11 @@ contact_list_store_remove_contact (EmpathyContactListStore *store,
                return;
        }
 
+       /* GtkTreeRowReference owns a ref on the store so removing it from the cache
+        * may drop our latest reference on the store. Ref it to be sure it stays
+        * alive during all the process. */
+       g_object_ref (store);
+
        /* Clean up model */
        model = GTK_TREE_MODEL (store);
 
@@ -1166,6 +1171,8 @@ contact_list_store_remove_contact (EmpathyContactListStore *store,
        }
 
        g_hash_table_remove (priv->empathy_contact_cache, contact);
+
+       g_object_unref (store);
 }
 
 static void