diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-11 18:35:26 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-11 21:10:43 +0800 |
commit | 6a5b51b273fc447c7611675b97268fc99216d430 (patch) | |
tree | 1c3b87bd9aea1d122dbb829c6c3bcec831fed9c6 /src | |
parent | 57b261b8329e12d1ffcc46e7ecfbeca2caa8fb4b (diff) | |
download | gsoc2013-empathy-6a5b51b273fc447c7611675b97268fc99216d430.tar.gz gsoc2013-empathy-6a5b51b273fc447c7611675b97268fc99216d430.tar.zst gsoc2013-empathy-6a5b51b273fc447c7611675b97268fc99216d430.zip |
use tp_account_manager_dup_valid_accounts()
tp_account_manager_get_valid_accounts() has been deprecated.
Fix an accounts list leak in empathy-sanity-cleaning.
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-accounts-common.c | 8 | ||||
-rw-r--r-- | src/empathy-accounts-dialog.c | 4 | ||||
-rw-r--r-- | src/empathy-accounts.c | 4 | ||||
-rw-r--r-- | src/empathy-debug-window.c | 4 | ||||
-rw-r--r-- | src/empathy-import-widget.c | 4 | ||||
-rw-r--r-- | src/empathy-roster-window.c | 9 | ||||
-rw-r--r-- | src/empathy-sanity-cleaning.c | 12 | ||||
-rw-r--r-- | src/empathy-status-icon.c | 4 | ||||
-rw-r--r-- | src/empathy.c | 4 |
9 files changed, 28 insertions, 25 deletions
diff --git a/src/empathy-accounts-common.c b/src/empathy-accounts-common.c index 7550c7183..d975c55b0 100644 --- a/src/empathy-accounts-common.c +++ b/src/empathy-accounts-common.c @@ -51,7 +51,7 @@ empathy_accounts_has_non_salut_accounts (TpAccountManager *manager) gboolean ret = FALSE; GList *accounts, *l; - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); for (l = accounts ; l != NULL; l = g_list_next (l)) { @@ -62,7 +62,7 @@ empathy_accounts_has_non_salut_accounts (TpAccountManager *manager) } } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); return ret; } @@ -73,9 +73,9 @@ empathy_accounts_has_accounts (TpAccountManager *manager) GList *accounts; gboolean has_accounts; - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); has_accounts = (accounts != NULL); - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); return has_accounts; } diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index cb8c7f784..3234cead4 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -2199,12 +2199,12 @@ accounts_dialog_accounts_setup (EmpathyAccountsDialog *dialog) dialog); /* Add existing accounts */ - accounts = tp_account_manager_get_valid_accounts (priv->account_manager); + accounts = tp_account_manager_dup_valid_accounts (priv->account_manager); for (l = accounts; l; l = l->next) { accounts_dialog_add_account (dialog, l->data); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); priv->cms = empathy_connection_managers_dup_singleton (); diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c index 027d99918..aa0e5b67b 100644 --- a/src/empathy-accounts.c +++ b/src/empathy-accounts.c @@ -77,7 +77,7 @@ find_account (TpAccountManager *mgr, GList *accounts, *l; TpAccount *found = NULL; - accounts = tp_account_manager_get_valid_accounts (mgr); + accounts = tp_account_manager_dup_valid_accounts (mgr); for (l = accounts; l != NULL; l = g_list_next (l)) { if (!tp_strdiff (tp_proxy_get_object_path (l->data), path)) @@ -87,7 +87,7 @@ find_account (TpAccountManager *mgr, } } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); return found; } diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c index 11c33453d..159db0b09 100644 --- a/src/empathy-debug-window.c +++ b/src/empathy-debug-window.c @@ -795,7 +795,7 @@ get_cm_display_name (EmpathyDebugWindow *self, GList *accounts, *ptr; char *retval; - accounts = tp_account_manager_get_valid_accounts (self->priv->am); + accounts = tp_account_manager_dup_valid_accounts (self->priv->am); for (ptr = accounts; ptr != NULL; ptr = ptr->next) { @@ -809,7 +809,7 @@ get_cm_display_name (EmpathyDebugWindow *self, } } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); if (g_hash_table_size (protocols) > 0) { diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c index b65e0c0cf..1994280ee 100644 --- a/src/empathy-import-widget.c +++ b/src/empathy-import-widget.c @@ -123,14 +123,14 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self) value = g_hash_table_lookup (data->settings, "account"); - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); /* Only set the "Import" cell to be active if there isn't already an * account set up with the same account id. */ import = !import_widget_account_id_in_list (accounts, g_value_get_string (value)); - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, -1, COL_IMPORT, import, diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index f0b30cf77..8ce915396 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -1507,7 +1507,7 @@ set_notebook_page (EmpathyRosterWindow *self) gtk_spinner_stop (GTK_SPINNER (self->priv->spinner_loading)); - accounts = tp_account_manager_get_valid_accounts ( + accounts = tp_account_manager_dup_valid_accounts ( self->priv->account_manager); len = g_list_length (accounts); @@ -1560,7 +1560,7 @@ set_notebook_page (EmpathyRosterWindow *self) display_page_contact_list (self); out: - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void @@ -1636,7 +1636,8 @@ account_manager_prepared_cb (GObject *source_object, return; } - accounts = tp_account_manager_get_valid_accounts (self->priv->account_manager); + accounts = tp_account_manager_dup_valid_accounts ( + self->priv->account_manager); for (j = accounts; j != NULL; j = j->next) { TpAccount *account = TP_ACCOUNT (j->data); @@ -1655,7 +1656,7 @@ account_manager_prepared_cb (GObject *source_object, set_notebook_page (self); - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } void diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c index e810fcb29..60cecc972 100644 --- a/src/empathy-sanity-cleaning.c +++ b/src/empathy-sanity-cleaning.c @@ -126,7 +126,7 @@ fix_xmpp_account_priority (TpAccountManager *am) { GList *accounts, *l; - accounts = tp_account_manager_get_valid_accounts (am); + accounts = tp_account_manager_dup_valid_accounts (am); for (l = accounts; l != NULL; l = g_list_next (l)) { TpAccount *account = l->data; @@ -157,7 +157,7 @@ fix_xmpp_account_priority (TpAccountManager *am) g_hash_table_unref (params); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void @@ -165,7 +165,7 @@ set_facebook_account_fallback_server (TpAccountManager *am) { GList *accounts, *l; - accounts = tp_account_manager_get_valid_accounts (am); + accounts = tp_account_manager_dup_valid_accounts (am); for (l = accounts; l != NULL; l = g_list_next (l)) { TpAccount *account = l->data; @@ -197,7 +197,7 @@ set_facebook_account_fallback_server (TpAccountManager *am) g_hash_table_unref (params); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void @@ -540,7 +540,7 @@ migrate_accounts_to_uoa (SanityCtx *ctx) manager = empathy_uoa_manager_dup (); - accounts = tp_account_manager_get_valid_accounts (ctx->am); + accounts = tp_account_manager_dup_valid_accounts (ctx->am); for (l = accounts; l != NULL; l = g_list_next (l)) { TpAccount *account = l->data; @@ -562,6 +562,8 @@ migrate_accounts_to_uoa (SanityCtx *ctx) migrate_account_to_uoa (ctx->am, account); } + g_list_free_full (accounts, g_object_unref); + g_object_unref (manager); } #endif diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c index 3aa27a467..517dd1df2 100644 --- a/src/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -445,13 +445,13 @@ account_manager_prepared_cb (GObject *source_object, return; } - list = tp_account_manager_get_valid_accounts (account_manager); + list = tp_account_manager_dup_valid_accounts (account_manager); for (l = list; l != NULL; l = l->next) { tp_g_signal_connect_object (l->data, "status-changed", G_CALLBACK (status_icon_status_changed_cb), icon, 0); } - g_list_free (list); + g_list_free_full (list, g_object_unref); status_icon_presence_changed_cb (icon); } diff --git a/src/empathy.c b/src/empathy.c index 70b45bb34..a75cf3e16 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -709,7 +709,7 @@ account_manager_chatroom_ready_cb (GObject *source_object, return; } - accounts = tp_account_manager_get_valid_accounts (account_manager); + accounts = tp_account_manager_dup_valid_accounts (account_manager); for (l = accounts; l != NULL; l = g_list_next (l)) { @@ -722,7 +722,7 @@ account_manager_chatroom_ready_cb (GObject *source_object, tp_g_signal_connect_object (account, "notify::connection", G_CALLBACK (account_connection_changed_cb), chatroom_manager, 0); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void |