aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-10-01 19:42:48 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-10-01 19:42:48 +0800
commit64892cb5dd16bb1478e7dd02e73c99a88889a9a0 (patch)
tree571e1ffa52ef4e30b0b4258a7cfd91f910ab20ce
parent6430bd3bbf43d0c2d0da05c54a39936a22ecf2a4 (diff)
downloadgsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar.gz
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar.bz2
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar.lz
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar.xz
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.tar.zst
gsoc2013-empathy-64892cb5dd16bb1478e7dd02e73c99a88889a9a0.zip
Disconnect signals on list and contacts when finalizing the store.
2007-10-01 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-contact-list-store.c: Disconnect signals on list and contacts when finalizing the store. svn path=/trunk/; revision=345
-rw-r--r--ChangeLog5
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c36
2 files changed, 40 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 36f45346a..f748cdac6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-10-01 Xavier Claessens <xclaesse@gmail.com>
+ * libempathy-gtk/empathy-contact-list-store.c: Disconnect signals on
+ list and contacts when finalizing the store.
+
+2007-10-01 Xavier Claessens <xclaesse@gmail.com>
+
* libempathy-gtk/empathy-contact-list-view.c:
* libempathy-gtk/empathy-chat-window.c: Hide VOIP stuff if empathy is
not compiled with --enable-voip=yes. Fixes bug #482111
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 81f50c8a6..6ca5c60a1 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -93,6 +93,10 @@ 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,
@@ -228,9 +232,17 @@ contact_list_store_finalize (GObject *object)
priv = GET_PRIV (object);
- /* FIXME: disconnect all signals on the list and contacts */
+ gtk_tree_model_foreach (GTK_TREE_MODEL (object),
+ (GtkTreeModelForeachFunc) contact_list_store_finalize_foreach,
+ object);
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),
+ object);
g_object_unref (priv->list);
}
@@ -609,6 +621,28 @@ 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,
+ 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)
{