From 7af1dee75adc774fedbdf9ec7e473f490528795b Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 14 Jul 2008 08:18:46 +0000 Subject: [PATCH] Fix leaked accounts. mc_accounts_list ref all accounts. svn path=/trunk/; revision=1226 --- libempathy-gtk/empathy-accounts-dialog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c index b88510c6..8e62f1ad 100644 --- a/libempathy-gtk/empathy-accounts-dialog.c +++ b/libempathy-gtk/empathy-accounts-dialog.c @@ -174,6 +174,7 @@ accounts_dialog_setup (EmpathyAccountsDialog *dialog) name = mc_account_get_display_name (account); if (!name) { + g_object_unref (account); continue; } @@ -765,17 +766,19 @@ accounts_dialog_status_changed_cb (MissionControl *mc, g_object_unref (account); /* Check if there is still accounts in CONNECTING state */ - accounts = mc_accounts_list (); + accounts = mc_accounts_list_by_enabled (TRUE); for (l = accounts; l; l = l->next) { - McAccount *this_account; + McAccount *this_account = l->data; TpConnectionStatus status; - this_account = l->data; + if (found) { + g_object_unref (this_account); + continue; + } status = mission_control_get_connection_status (mc, this_account, NULL); if (status == TP_CONNECTION_STATUS_CONNECTING) { found = TRUE; - break; } g_object_unref (this_account); -- 2.39.2