From 683c88254e5488ef7b0d8d0e0fd05f46c41f5914 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 9 Sep 2011 12:49:46 +0200 Subject: contact_list_store_remove_contact: ensure that the store stays alive during the process https://bugzilla.gnome.org/show_bug.cgi?id=658644 --- libempathy-gtk/empathy-contact-list-store.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 189df5dc5..fb15840e9 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -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 -- cgit v1.2.3