]> git.0d.be Git - empathy.git/commitdiff
disconnect from invalidated signal before unreferencing connections
authorElliot Fairweather <elliot.fairweather@collabora.co.uk>
Fri, 26 Jun 2009 13:49:30 +0000 (14:49 +0100)
committerElliot Fairweather <elliot.fairweather@collabora.co.uk>
Fri, 26 Jun 2009 13:49:30 +0000 (14:49 +0100)
libempathy/empathy-account-manager.c

index dd0a72f5900dc8d9fb3fe457682533e1ae1ace93..ff9fd2525be0e1dabbeaad3fd8761ca208cd7a41 100644 (file)
@@ -504,6 +504,18 @@ empathy_account_manager_init (EmpathyAccountManager *manager)
   mc_accounts_list_free (mc_accounts);
 }
 
+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)
 {
@@ -511,6 +523,8 @@ do_finalize (GObject *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);