diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-10-19 20:54:34 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-10-19 21:13:07 +0800 |
commit | 5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944 (patch) | |
tree | da13f4af4275bc62827f7d80b3dc8c831986db30 | |
parent | bd6b127e4ae3f816cfef4c7d9015566f9ca79365 (diff) | |
download | gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar.gz gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar.bz2 gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar.lz gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar.xz gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.tar.zst gsoc2013-empathy-5c7d19ff6bf25ba055f9e8dfdf93a366bd92f944.zip |
empathy-contact-list-store: remove the setup idle cb when store is destroyed
This ensures that the setup cb isn't called on a destroyed object
(#598452).
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 5edcded95..6d6e422bd 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -63,6 +63,7 @@ typedef struct { gboolean show_active; EmpathyContactListStoreSort sort_criterium; guint inhibit_active; + guint setup_idle_id; } EmpathyContactListStorePriv; typedef struct { @@ -193,6 +194,7 @@ contact_list_store_iface_setup (gpointer user_data) } g_list_free (contacts); + priv->setup_idle_id = 0; return FALSE; } @@ -206,7 +208,7 @@ contact_list_store_set_contact_list (EmpathyContactListStore *store, priv->list = g_object_ref (list_iface); /* Let a chance to have all properties set before populating */ - g_idle_add (contact_list_store_iface_setup, store); + priv->setup_idle_id = g_idle_add (contact_list_store_iface_setup, store); } static void @@ -313,6 +315,10 @@ contact_list_store_finalize (GObject *object) g_source_remove (priv->inhibit_active); } + if (priv->setup_idle_id != 0) { + g_source_remove (priv->setup_idle_id); + } + G_OBJECT_CLASS (empathy_contact_list_store_parent_class)->finalize (object); } |