[empathy] individual_store_remove_individual: ensure that the store stays alive during the process



commit 56f569b22192230080eb6c20d0d5474fa7e47086
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Sep 9 12:51:33 2011 +0200

    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 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index d80d292..943dd5b 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]