From 6a5b51b273fc447c7611675b97268fc99216d430 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 11 Sep 2012 12:35:26 +0200 Subject: 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. --- libempathy-gtk/empathy-account-chooser.c | 4 ++-- libempathy-gtk/empathy-chat.c | 4 ++-- libempathy-gtk/empathy-contact-blocking-dialog.c | 4 ++-- libempathy-gtk/empathy-contact-chooser.c | 4 ++-- libempathy-gtk/empathy-individual-menu.c | 4 ++-- libempathy-gtk/empathy-local-xmpp-assistant-widget.c | 4 ++-- libempathy-gtk/empathy-location-manager.c | 8 ++++---- libempathy-gtk/empathy-log-window.c | 4 ++-- libempathy-gtk/empathy-presence-chooser.c | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index ae3f1dd15..6e7ec2940 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -280,7 +280,7 @@ account_manager_prepared_cb (GObject *source_object, return; } - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); for (l = accounts; l != NULL; l = l->next) { @@ -301,7 +301,7 @@ account_manager_prepared_cb (GObject *source_object, self, 0); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); if (self->priv->select_when_ready != NULL) { diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 6eb1443d7..308587b52 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -3518,7 +3518,7 @@ account_manager_prepared_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 = l->next) { TpAccount *account = l->data; @@ -3527,7 +3527,7 @@ account_manager_prepared_cb (GObject *source_object, chat, 0); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void diff --git a/libempathy-gtk/empathy-contact-blocking-dialog.c b/libempathy-gtk/empathy-contact-blocking-dialog.c index 58d574925..9a0498c5a 100644 --- a/libempathy-gtk/empathy-contact-blocking-dialog.c +++ b/libempathy-gtk/empathy-contact-blocking-dialog.c @@ -234,7 +234,7 @@ contact_blocking_dialog_am_prepared (GObject *am, return; } - accounts = tp_account_manager_get_valid_accounts (TP_ACCOUNT_MANAGER (am)); + accounts = tp_account_manager_dup_valid_accounts (TP_ACCOUNT_MANAGER (am)); for (ptr = accounts; ptr != NULL; ptr = ptr->next) { @@ -247,7 +247,7 @@ contact_blocking_dialog_am_prepared (GObject *am, contact_blocking_dialog_refilter_account_chooser (self); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c index 880646711..69cfdef69 100644 --- a/libempathy-gtk/empathy-contact-chooser.c +++ b/libempathy-gtk/empathy-contact-chooser.c @@ -283,7 +283,7 @@ add_temporary_individuals (EmpathyContactChooser *self, self->priv->add_temp_ctx = add_temporary_individual_ctx_new (self); /* Try to add an individual for each connected account */ - accounts = tp_account_manager_get_valid_accounts (self->priv->account_mgr); + accounts = tp_account_manager_dup_valid_accounts (self->priv->account_mgr); for (l = accounts; l != NULL; l = g_list_next (l)) { TpAccount *account = l->data; @@ -303,7 +303,7 @@ add_temporary_individuals (EmpathyContactChooser *self, g_object_unref (factory); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c index c485b9b5f..6058c4938 100644 --- a/libempathy-gtk/empathy-individual-menu.c +++ b/libempathy-gtk/empathy-individual-menu.c @@ -288,7 +288,7 @@ find_phone_accounts (void) am = tp_account_manager_dup (); g_return_val_if_fail (am != NULL, NULL); - 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; @@ -303,7 +303,7 @@ find_phone_accounts (void) found = g_list_prepend (found, g_object_ref (account)); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); g_object_unref (am); return found; diff --git a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c index c55e3ab30..b714fa499 100644 --- a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c +++ b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c @@ -223,7 +223,7 @@ empathy_local_xmpp_assistant_widget_should_create_account ( gboolean salut_created = 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)) { @@ -236,7 +236,7 @@ empathy_local_xmpp_assistant_widget_should_create_account ( } } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); return !salut_created; } diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c index 233afb788..576ced529 100644 --- a/libempathy-gtk/empathy-location-manager.c +++ b/libempathy-gtk/empathy-location-manager.c @@ -189,7 +189,7 @@ publish_to_all_am_prepared_cb (GObject *source_object, goto out; } - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); for (l = accounts; l; l = l->next) { TpConnection *conn = tp_account_get_connection (TP_ACCOUNT (l->data)); @@ -197,7 +197,7 @@ publish_to_all_am_prepared_cb (GObject *source_object, if (conn != NULL) publish_location (data->self, conn, data->force_publication); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); out: g_object_unref (data->self); @@ -675,7 +675,7 @@ account_manager_prepared_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 = l->next) { TpAccount *account = TP_ACCOUNT (l->data); @@ -683,7 +683,7 @@ account_manager_prepared_cb (GObject *source_object, tp_g_signal_connect_object (account, "status-changed", G_CALLBACK (new_connection_cb), self, 0); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } static void diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index ff274a6aa..6a244f503 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -2499,7 +2499,7 @@ log_window_who_populate (EmpathyLogWindow *self) GList *accounts, *l; manager = empathy_account_chooser_get_account_manager (account_chooser); - accounts = tp_account_manager_get_valid_accounts (manager); + accounts = tp_account_manager_dup_valid_accounts (manager); for (l = accounts; l != NULL; l = l->next) { @@ -2510,7 +2510,7 @@ log_window_who_populate (EmpathyLogWindow *self) get_entities_for_account, ctx); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); } _tpl_action_chain_append (self->priv->chain, select_first_entity, self); _tpl_action_chain_start (self->priv->chain); diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 08325d402..1eb4a48a5 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -759,7 +759,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object, return; } - 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)) { TpAccount *a = TP_ACCOUNT (l->data); @@ -770,7 +770,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object, } } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); if (!g_network_monitor_get_network_available (priv->connectivity)) sensitive = FALSE; -- cgit v1.2.3