aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-06-28 15:58:53 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-06-28 15:58:53 +0800
commit5e30d8dcf1b80b6281df6bd872bb4455f28c1b23 (patch)
tree70b4b92fd0533a19cf724811ceafb94edc14d2f2 /libempathy
parent8ffe9c1d74fa04ed7dfb898a8760469e8df16915 (diff)
parent240b54dbfe75e1d24a7619cf22e2ffd3acbb6427 (diff)
downloadgsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar.gz
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar.bz2
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar.lz
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar.xz
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.tar.zst
gsoc2013-empathy-5e30d8dcf1b80b6281df6bd872bb4455f28c1b23.zip
Merge commit 'elliot/bug-584703-c'
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-account-manager.c14
-rw-r--r--libempathy/empathy-contact-manager.c44
2 files changed, 38 insertions, 20 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index dd0a72f59..ff9fd2525 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -505,12 +505,26 @@ empathy_account_manager_init (EmpathyAccountManager *manager)
}
static void
+account_manager_disconnect_foreach (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ TpConnection *connection = key;
+ EmpathyAccountManager *manager = user_data;
+
+ g_signal_handlers_disconnect_by_func (connection, connection_invalidated_cb,
+ manager);
+}
+
+static void
do_finalize (GObject *obj)
{
EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (obj);
EmpathyAccountManagerPriv *priv = GET_PRIV (manager);
g_hash_table_unref (priv->accounts);
+ g_hash_table_foreach (priv->connections, account_manager_disconnect_foreach,
+ obj);
g_hash_table_unref (priv->connections);
G_OBJECT_CLASS (empathy_account_manager_parent_class)->finalize (obj);
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index 073424485..7af2bd349 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -87,26 +87,6 @@ contact_manager_groups_changed_cb (EmpathyTpContactList *list,
}
static void
-contact_manager_disconnect_foreach (gpointer key,
- gpointer value,
- gpointer user_data)
-{
- EmpathyTpContactList *list = value;
- EmpathyContactManager *manager = user_data;
-
- /* Disconnect signals from the list */
- g_signal_handlers_disconnect_by_func (list,
- contact_manager_members_changed_cb,
- manager);
- g_signal_handlers_disconnect_by_func (list,
- contact_manager_pendings_changed_cb,
- manager);
- g_signal_handlers_disconnect_by_func (list,
- contact_manager_groups_changed_cb,
- manager);
-}
-
-static void
contact_manager_invalidated_cb (TpProxy *connection,
guint domain,
gint code,
@@ -128,6 +108,30 @@ contact_manager_invalidated_cb (TpProxy *connection,
}
static void
+contact_manager_disconnect_foreach (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ TpConnection *connection = key;
+ EmpathyTpContactList *list = value;
+ EmpathyContactManager *manager = user_data;
+
+ /* Disconnect signals from the list */
+ g_signal_handlers_disconnect_by_func (list,
+ contact_manager_members_changed_cb,
+ manager);
+ g_signal_handlers_disconnect_by_func (list,
+ contact_manager_pendings_changed_cb,
+ manager);
+ g_signal_handlers_disconnect_by_func (list,
+ contact_manager_groups_changed_cb,
+ manager);
+ g_signal_handlers_disconnect_by_func (connection,
+ contact_manager_invalidated_cb,
+ manager);
+}
+
+static void
contact_manager_new_connection_cb (EmpathyAccountManager *account_manager,
TpConnection *connection,
EmpathyContactManager *self)