]> git.0d.be Git - empathy.git/commitdiff
individual_store_remove_individual: ensure that the store stays alive during the...
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 9 Sep 2011 10:51:33 +0000 (12:51 +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-individual-store.c

index d80d292d09ac770ed101db6e6d373a352b073355..943dd5b8d68a70a991dafc2c21c2c6fa2454b09d 100644 (file)
@@ -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