From b4e924942d3090ad9df1d0443bfa98cccaf6680e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 23 Sep 2013 16:24:17 +0200 Subject: [PATCH 05/15] stop using tp_account_manager_get_valid_accounts() The code example in log-walker.c was wrong as get_valid_accounts() is (transfer container). dup_valid_accounts() is (transfer full) so it's correct now. https://bugs.freedesktop.org/show_bug.cgi?id=69797 --- telepathy-logger/log-store-pidgin.c | 4 ++-- telepathy-logger/log-store-xml.c | 4 ++-- telepathy-logger/log-walker.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/telepathy-logger/log-store-pidgin.c b/telepathy-logger/log-store-pidgin.c index a76c066..f3e46b8 100644 --- a/telepathy-logger/log-store-pidgin.c +++ b/telepathy-logger/log-store-pidgin.c @@ -488,7 +488,7 @@ log_store_pidgin_dup_account (const gchar *filename) gboolean is_irc; account_manager = tp_account_manager_dup (); - accounts = tp_account_manager_get_valid_accounts (account_manager); + accounts = tp_account_manager_dup_valid_accounts (account_manager); strv = g_strsplit (filename, G_DIR_SEPARATOR_S, -1); len = g_strv_length (strv); @@ -532,7 +532,7 @@ log_store_pidgin_dup_account (const gchar *filename) g_free (username); g_free (server); - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); g_strfreev (strv); g_object_unref (account_manager); diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c index 03f5d3c..ec291b4 100644 --- a/telepathy-logger/log-store-xml.c +++ b/telepathy-logger/log-store-xml.c @@ -1020,7 +1020,7 @@ log_store_xml_search_hit_new (TplLogStoreXml *self, /* FIXME: This assumes the account manager is prepared, but the * synchronous API forces this. See bug #599189. */ - accounts = tp_account_manager_get_valid_accounts ( + accounts = tp_account_manager_dup_valid_accounts ( self->priv->account_manager); for (l = accounts; l != NULL && account == NULL; l = g_list_next (l)) @@ -1033,7 +1033,7 @@ log_store_xml_search_hit_new (TplLogStoreXml *self, account = acc; g_free (name); } - g_list_free (accounts); + g_list_free_full (accounts, g_object_unref); if (is_chatroom) target = tpl_entity_new_from_room_id (chat_id); diff --git a/telepathy-logger/log-walker.c b/telepathy-logger/log-walker.c index d4b568d..4655f33 100644 --- a/telepathy-logger/log-walker.c +++ b/telepathy-logger/log-walker.c @@ -113,7 +113,7 @@ * if (!tp_proxy_prepare_finish (source_object, res, NULL)) * return; * - * accounts = tp_account_manager_get_valid_accounts (account_manager); + * accounts = tp_account_manager_dup_valid_accounts (account_manager); * g_list_foreach (accounts, accounts_foreach, &account); * g_list_free_full (accounts, g_object_unref); * if (account == NULL) -- 1.8.3.1