From 56f569b22192230080eb6c20d0d5474fa7e47086 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 9 Sep 2011 12:51:33 +0200 Subject: individual_store_remove_individual: ensure that the store stays alive during the process https://bugzilla.gnome.org/show_bug.cgi?id=658644 --- libempathy-gtk/empathy-individual-store.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index d80d292d0..943dd5b8d 100644 --- a/libempathy-gtk/empathy-individual-store.c +++ b/libempathy-gtk/empathy-individual-store.c @@ -378,6 +378,11 @@ individual_store_remove_individual (EmpathyIndividualStore *self, if (!row_refs) 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 (self); + /* Clean up model */ model = GTK_TREE_MODEL (self); @@ -417,6 +422,8 @@ individual_store_remove_individual (EmpathyIndividualStore *self, } g_hash_table_remove (priv->folks_individual_cache, individual); + + g_object_unref (self); } static void -- cgit v1.2.3