diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-14 23:51:03 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-14 23:51:03 +0800 |
commit | 5dc17e094fb35e462516b2fae78db04e3a7f356d (patch) | |
tree | 5ce24368c06115bc35ef00dc82c5056f662709be | |
parent | 569c0b8957f72a0d1681dcf08eafb2aaf63934e9 (diff) | |
download | gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar.gz gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar.bz2 gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar.lz gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar.xz gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.tar.zst gsoc2013-empathy-5dc17e094fb35e462516b2fae78db04e3a7f356d.zip |
fix bug #526374.
svn path=/trunk/; revision=943
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 57 |
1 files changed, 17 insertions, 40 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index b446fd19e..7074cee80 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -91,10 +91,6 @@ static void contact_list_store_set_property (GObject guint param_id, const GValue *value, GParamSpec *pspec); -static gboolean contact_list_store_finalize_foreach (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - gpointer user_data); static void contact_list_store_setup (EmpathyContactListStore *store); static gboolean contact_list_store_inibit_active_cb (EmpathyContactListStore *store); static void contact_list_store_members_changed_cb (EmpathyContactList *list_iface, @@ -292,23 +288,26 @@ empathy_contact_list_store_init (EmpathyContactListStore *store) static void contact_list_store_finalize (GObject *object) { - EmpathyContactListStorePriv *priv; - - priv = GET_PRIV (object); - - gtk_tree_model_foreach (GTK_TREE_MODEL (object), - (GtkTreeModelForeachFunc) contact_list_store_finalize_foreach, - object); + EmpathyContactListStorePriv *priv = GET_PRIV (object); + GList *contacts, *l; - if (priv->list) { - g_signal_handlers_disconnect_by_func (priv->list, - G_CALLBACK (contact_list_store_members_changed_cb), - object); - g_signal_handlers_disconnect_by_func (priv->list, - G_CALLBACK (contact_list_store_groups_changed_cb), + contacts = empathy_contact_list_get_members (priv->list); + for (l = contacts; l; l = l->next) { + g_signal_handlers_disconnect_by_func (l->data, + G_CALLBACK (contact_list_store_contact_updated_cb), object); - g_object_unref (priv->list); + + g_object_unref (l->data); } + g_list_free (contacts); + + g_signal_handlers_disconnect_by_func (priv->list, + G_CALLBACK (contact_list_store_members_changed_cb), + object); + g_signal_handlers_disconnect_by_func (priv->list, + G_CALLBACK (contact_list_store_groups_changed_cb), + object); + g_object_unref (priv->list); if (priv->inhibit_active) { g_source_remove (priv->inhibit_active); @@ -725,28 +724,6 @@ empathy_contact_list_store_search_equal_func (GtkTreeModel *model, return ret; } -static gboolean -contact_list_store_finalize_foreach (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - gpointer user_data) -{ - EmpathyContactListStore *store = user_data; - EmpathyContact *contact = NULL; - - gtk_tree_model_get (GTK_TREE_MODEL (store), iter, - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, - -1); - - if (contact) { - g_signal_handlers_disconnect_by_func (contact, - G_CALLBACK (contact_list_store_contact_updated_cb), - store); - } - - return FALSE; -} - static void contact_list_store_setup (EmpathyContactListStore *store) { |