[empathy] contact_list_store_remove_contact: ensure that the store stays alive during the process
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] contact_list_store_remove_contact: ensure that the store stays alive during the process
- Date: Fri, 9 Sep 2011 10:57:15 +0000 (UTC)
commit 683c88254e5488ef7b0d8d0e0fd05f46c41f5914
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Sep 9 12:49:46 2011 +0200
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 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 189df5d..fb15840 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]