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.
Guillaume Desmottes
11 years ago
187 | 187 |
goto out;
|
188 | 188 |
}
|
189 | 189 |
|
190 | |
accounts = tp_account_manager_get_valid_accounts (self->priv->mgr);
|
|
190 |
accounts = tp_account_manager_dup_valid_accounts (self->priv->mgr);
|
191 | 191 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
192 | 192 |
{
|
193 | 193 |
TpAccount *account = l->data;
|
|
198 | 198 |
tp_g_signal_connect_object (self->priv->mgr, "account-validity-changed",
|
199 | 199 |
G_CALLBACK (account_validity_changed_cb), self, 0);
|
200 | 200 |
|
201 | |
g_list_free (accounts);
|
|
201 |
g_list_free_full (accounts, g_object_unref);
|
202 | 202 |
|
203 | 203 |
out:
|
204 | 204 |
g_object_unref (self);
|
432 | 432 |
most_available_presence_changed (account_manager, state, status,
|
433 | 433 |
status_message, self);
|
434 | 434 |
|
435 | |
accounts = tp_account_manager_get_valid_accounts (self->priv->manager);
|
|
435 |
accounts = tp_account_manager_dup_valid_accounts (self->priv->manager);
|
436 | 436 |
for (l = accounts; l != NULL; l = l->next)
|
437 | 437 |
{
|
438 | 438 |
tp_g_signal_connect_object (l->data, "status-changed",
|
439 | 439 |
G_CALLBACK (account_status_changed_cb), self, 0);
|
440 | 440 |
}
|
441 | |
g_list_free (accounts);
|
|
441 |
g_list_free_full (accounts, g_object_unref);
|
442 | 442 |
|
443 | 443 |
g_free (status);
|
444 | 444 |
g_free (status_message);
|
566 | 566 |
TP_ACCOUNT_MANAGER_FEATURE_CORE)))
|
567 | 567 |
g_critical (G_STRLOC ": %s called before AccountManager ready", G_STRFUNC);
|
568 | 568 |
|
569 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
569 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
570 | 570 |
|
571 | 571 |
for (l = accounts; l != NULL; l = l->next)
|
572 | 572 |
{
|
|
582 | 582 |
break;
|
583 | 583 |
}
|
584 | 584 |
|
585 | |
g_list_free (accounts);
|
|
585 |
g_list_free_full (accounts, g_object_unref);
|
586 | 586 |
g_object_unref (manager);
|
587 | 587 |
|
588 | 588 |
if (connecting != NULL)
|
233 | 233 |
return;
|
234 | 234 |
}
|
235 | 235 |
|
236 | |
accounts = tp_account_manager_get_valid_accounts (TP_ACCOUNT_MANAGER (am));
|
|
236 |
accounts = tp_account_manager_dup_valid_accounts (TP_ACCOUNT_MANAGER (am));
|
237 | 237 |
|
238 | 238 |
for (ptr = accounts; ptr != NULL; ptr = ptr->next)
|
239 | 239 |
{
|
|
246 | 246 |
contact_blocking_dialog_refilter_account_chooser (self);
|
247 | 247 |
}
|
248 | 248 |
|
249 | |
g_list_free (accounts);
|
|
249 |
g_list_free_full (accounts, g_object_unref);
|
250 | 250 |
}
|
251 | 251 |
|
252 | 252 |
static void
|
282 | 282 |
self->priv->add_temp_ctx = add_temporary_individual_ctx_new (self);
|
283 | 283 |
|
284 | 284 |
/* Try to add an individual for each connected account */
|
285 | |
accounts = tp_account_manager_get_valid_accounts (self->priv->account_mgr);
|
|
285 |
accounts = tp_account_manager_dup_valid_accounts (self->priv->account_mgr);
|
286 | 286 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
287 | 287 |
{
|
288 | 288 |
TpAccount *account = l->data;
|
|
302 | 302 |
g_object_unref (factory);
|
303 | 303 |
}
|
304 | 304 |
|
305 | |
g_list_free (accounts);
|
|
305 |
g_list_free_full (accounts, g_object_unref);
|
306 | 306 |
}
|
307 | 307 |
|
308 | 308 |
static void
|
287 | 287 |
am = tp_account_manager_dup ();
|
288 | 288 |
g_return_val_if_fail (am != NULL, NULL);
|
289 | 289 |
|
290 | |
accounts = tp_account_manager_get_valid_accounts (am);
|
|
290 |
accounts = tp_account_manager_dup_valid_accounts (am);
|
291 | 291 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
292 | 292 |
{
|
293 | 293 |
TpAccount *account = l->data;
|
|
302 | 302 |
found = g_list_prepend (found, g_object_ref (account));
|
303 | 303 |
}
|
304 | 304 |
|
305 | |
g_list_free (accounts);
|
|
305 |
g_list_free_full (accounts, g_object_unref);
|
306 | 306 |
g_object_unref (am);
|
307 | 307 |
|
308 | 308 |
return found;
|
222 | 222 |
gboolean salut_created = FALSE;
|
223 | 223 |
GList *accounts, *l;
|
224 | 224 |
|
225 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
225 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
226 | 226 |
|
227 | 227 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
228 | 228 |
{
|
|
235 | 235 |
}
|
236 | 236 |
}
|
237 | 237 |
|
238 | |
g_list_free (accounts);
|
|
238 |
g_list_free_full (accounts, g_object_unref);
|
239 | 239 |
|
240 | 240 |
return !salut_created;
|
241 | 241 |
}
|
188 | 188 |
goto out;
|
189 | 189 |
}
|
190 | 190 |
|
191 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
191 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
192 | 192 |
for (l = accounts; l; l = l->next)
|
193 | 193 |
{
|
194 | 194 |
TpConnection *conn = tp_account_get_connection (TP_ACCOUNT (l->data));
|
|
196 | 196 |
if (conn != NULL)
|
197 | 197 |
publish_location (data->self, conn, data->force_publication);
|
198 | 198 |
}
|
199 | |
g_list_free (accounts);
|
|
199 |
g_list_free_full (accounts, g_object_unref);
|
200 | 200 |
|
201 | 201 |
out:
|
202 | 202 |
g_object_unref (data->self);
|
|
674 | 674 |
return;
|
675 | 675 |
}
|
676 | 676 |
|
677 | |
accounts = tp_account_manager_get_valid_accounts (account_manager);
|
|
677 |
accounts = tp_account_manager_dup_valid_accounts (account_manager);
|
678 | 678 |
for (l = accounts; l != NULL; l = l->next)
|
679 | 679 |
{
|
680 | 680 |
TpAccount *account = TP_ACCOUNT (l->data);
|
|
682 | 682 |
tp_g_signal_connect_object (account, "status-changed",
|
683 | 683 |
G_CALLBACK (new_connection_cb), self, 0);
|
684 | 684 |
}
|
685 | |
g_list_free (accounts);
|
|
685 |
g_list_free_full (accounts, g_object_unref);
|
686 | 686 |
}
|
687 | 687 |
|
688 | 688 |
static void
|
2498 | 2498 |
GList *accounts, *l;
|
2499 | 2499 |
|
2500 | 2500 |
manager = empathy_account_chooser_get_account_manager (account_chooser);
|
2501 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
2501 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
2502 | 2502 |
|
2503 | 2503 |
for (l = accounts; l != NULL; l = l->next)
|
2504 | 2504 |
{
|
|
2509 | 2509 |
get_entities_for_account, ctx);
|
2510 | 2510 |
}
|
2511 | 2511 |
|
2512 | |
g_list_free (accounts);
|
|
2512 |
g_list_free_full (accounts, g_object_unref);
|
2513 | 2513 |
}
|
2514 | 2514 |
_tpl_action_chain_append (self->priv->chain, select_first_entity, self);
|
2515 | 2515 |
_tpl_action_chain_start (self->priv->chain);
|
758 | 758 |
return;
|
759 | 759 |
}
|
760 | 760 |
|
761 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
761 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
762 | 762 |
|
763 | 763 |
for (l = accounts ; l != NULL ; l = g_list_next (l)) {
|
764 | 764 |
TpAccount *a = TP_ACCOUNT (l->data);
|
|
769 | 769 |
}
|
770 | 770 |
}
|
771 | 771 |
|
772 | |
g_list_free (accounts);
|
|
772 |
g_list_free_full (accounts, g_object_unref);
|
773 | 773 |
|
774 | 774 |
if (!g_network_monitor_get_network_available (priv->connectivity))
|
775 | 775 |
sensitive = FALSE;
|
50 | 50 |
gboolean ret = FALSE;
|
51 | 51 |
GList *accounts, *l;
|
52 | 52 |
|
53 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
53 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
54 | 54 |
|
55 | 55 |
for (l = accounts ; l != NULL; l = g_list_next (l))
|
56 | 56 |
{
|
|
61 | 61 |
}
|
62 | 62 |
}
|
63 | 63 |
|
64 | |
g_list_free (accounts);
|
|
64 |
g_list_free_full (accounts, g_object_unref);
|
65 | 65 |
|
66 | 66 |
return ret;
|
67 | 67 |
}
|
|
72 | 72 |
GList *accounts;
|
73 | 73 |
gboolean has_accounts;
|
74 | 74 |
|
75 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
75 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
76 | 76 |
has_accounts = (accounts != NULL);
|
77 | |
g_list_free (accounts);
|
|
77 |
g_list_free_full (accounts, g_object_unref);
|
78 | 78 |
|
79 | 79 |
return has_accounts;
|
80 | 80 |
}
|
2198 | 2198 |
dialog);
|
2199 | 2199 |
|
2200 | 2200 |
/* Add existing accounts */
|
2201 | |
accounts = tp_account_manager_get_valid_accounts (priv->account_manager);
|
|
2201 |
accounts = tp_account_manager_dup_valid_accounts (priv->account_manager);
|
2202 | 2202 |
for (l = accounts; l; l = l->next)
|
2203 | 2203 |
{
|
2204 | 2204 |
accounts_dialog_add_account (dialog, l->data);
|
2205 | 2205 |
}
|
2206 | |
g_list_free (accounts);
|
|
2206 |
g_list_free_full (accounts, g_object_unref);
|
2207 | 2207 |
|
2208 | 2208 |
priv->cms = empathy_connection_managers_dup_singleton ();
|
2209 | 2209 |
|
76 | 76 |
GList *accounts, *l;
|
77 | 77 |
TpAccount *found = NULL;
|
78 | 78 |
|
79 | |
accounts = tp_account_manager_get_valid_accounts (mgr);
|
|
79 |
accounts = tp_account_manager_dup_valid_accounts (mgr);
|
80 | 80 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
81 | 81 |
{
|
82 | 82 |
if (!tp_strdiff (tp_proxy_get_object_path (l->data), path))
|
|
86 | 86 |
}
|
87 | 87 |
}
|
88 | 88 |
|
89 | |
g_list_free (accounts);
|
|
89 |
g_list_free_full (accounts, g_object_unref);
|
90 | 90 |
return found;
|
91 | 91 |
}
|
92 | 92 |
|
794 | 794 |
GList *accounts, *ptr;
|
795 | 795 |
char *retval;
|
796 | 796 |
|
797 | |
accounts = tp_account_manager_get_valid_accounts (self->priv->am);
|
|
797 |
accounts = tp_account_manager_dup_valid_accounts (self->priv->am);
|
798 | 798 |
|
799 | 799 |
for (ptr = accounts; ptr != NULL; ptr = ptr->next)
|
800 | 800 |
{
|
|
808 | 808 |
}
|
809 | 809 |
}
|
810 | 810 |
|
811 | |
g_list_free (accounts);
|
|
811 |
g_list_free_full (accounts, g_object_unref);
|
812 | 812 |
|
813 | 813 |
if (g_hash_table_size (protocols) > 0)
|
814 | 814 |
{
|
122 | 122 |
|
123 | 123 |
value = g_hash_table_lookup (data->settings, "account");
|
124 | 124 |
|
125 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
125 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
126 | 126 |
|
127 | 127 |
/* Only set the "Import" cell to be active if there isn't already an
|
128 | 128 |
* account set up with the same account id. */
|
129 | 129 |
import = !import_widget_account_id_in_list (accounts,
|
130 | 130 |
g_value_get_string (value));
|
131 | 131 |
|
132 | |
g_list_free (accounts);
|
|
132 |
g_list_free_full (accounts, g_object_unref);
|
133 | 133 |
|
134 | 134 |
gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, -1,
|
135 | 135 |
COL_IMPORT, import,
|
125 | 125 |
{
|
126 | 126 |
GList *accounts, *l;
|
127 | 127 |
|
128 | |
accounts = tp_account_manager_get_valid_accounts (am);
|
|
128 |
accounts = tp_account_manager_dup_valid_accounts (am);
|
129 | 129 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
130 | 130 |
{
|
131 | 131 |
TpAccount *account = l->data;
|
|
156 | 156 |
g_hash_table_unref (params);
|
157 | 157 |
}
|
158 | 158 |
|
159 | |
g_list_free (accounts);
|
|
159 |
g_list_free_full (accounts, g_object_unref);
|
160 | 160 |
}
|
161 | 161 |
|
162 | 162 |
static void
|
|
164 | 164 |
{
|
165 | 165 |
GList *accounts, *l;
|
166 | 166 |
|
167 | |
accounts = tp_account_manager_get_valid_accounts (am);
|
|
167 |
accounts = tp_account_manager_dup_valid_accounts (am);
|
168 | 168 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
169 | 169 |
{
|
170 | 170 |
TpAccount *account = l->data;
|
|
196 | 196 |
g_hash_table_unref (params);
|
197 | 197 |
}
|
198 | 198 |
|
199 | |
g_list_free (accounts);
|
|
199 |
g_list_free_full (accounts, g_object_unref);
|
200 | 200 |
}
|
201 | 201 |
|
202 | 202 |
static void
|
|
539 | 539 |
|
540 | 540 |
manager = empathy_uoa_manager_dup ();
|
541 | 541 |
|
542 | |
accounts = tp_account_manager_get_valid_accounts (ctx->am);
|
|
542 |
accounts = tp_account_manager_dup_valid_accounts (ctx->am);
|
543 | 543 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
544 | 544 |
{
|
545 | 545 |
TpAccount *account = l->data;
|
|
560 | 560 |
|
561 | 561 |
migrate_account_to_uoa (ctx->am, account);
|
562 | 562 |
}
|
|
563 |
|
|
564 |
g_list_free_full (accounts, g_object_unref);
|
563 | 565 |
|
564 | 566 |
g_object_unref (manager);
|
565 | 567 |
}
|
444 | 444 |
return;
|
445 | 445 |
}
|
446 | 446 |
|
447 | |
list = tp_account_manager_get_valid_accounts (account_manager);
|
|
447 |
list = tp_account_manager_dup_valid_accounts (account_manager);
|
448 | 448 |
for (l = list; l != NULL; l = l->next) {
|
449 | 449 |
tp_g_signal_connect_object (l->data, "status-changed",
|
450 | 450 |
G_CALLBACK (status_icon_status_changed_cb),
|
451 | 451 |
icon, 0);
|
452 | 452 |
}
|
453 | |
g_list_free (list);
|
|
453 |
g_list_free_full (list, g_object_unref);
|
454 | 454 |
|
455 | 455 |
status_icon_presence_changed_cb (icon);
|
456 | 456 |
}
|
708 | 708 |
return;
|
709 | 709 |
}
|
710 | 710 |
|
711 | |
accounts = tp_account_manager_get_valid_accounts (account_manager);
|
|
711 |
accounts = tp_account_manager_dup_valid_accounts (account_manager);
|
712 | 712 |
|
713 | 713 |
for (l = accounts; l != NULL; l = g_list_next (l))
|
714 | 714 |
{
|
|
721 | 721 |
tp_g_signal_connect_object (account, "notify::connection",
|
722 | 722 |
G_CALLBACK (account_connection_changed_cb), chatroom_manager, 0);
|
723 | 723 |
}
|
724 | |
g_list_free (accounts);
|
|
724 |
g_list_free_full (accounts, g_object_unref);
|
725 | 725 |
}
|
726 | 726 |
|
727 | 727 |
static void
|
309 | 309 |
goto out;
|
310 | 310 |
}
|
311 | 311 |
|
312 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
312 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
313 | 313 |
while (accounts != NULL)
|
314 | 314 |
{
|
315 | 315 |
TpAccount *account = accounts->data;
|
|
327 | 327 |
|
328 | 328 |
accounts = g_list_delete_link (accounts, accounts);
|
329 | 329 |
}
|
330 | |
g_list_free (accounts);
|
|
330 |
g_list_free_full (accounts, g_object_unref);
|
331 | 331 |
|
332 | 332 |
out:
|
333 | 333 |
tp_weak_ref_destroy (wr);
|
194 | 194 |
goto out;
|
195 | 195 |
}
|
196 | 196 |
|
197 | |
accounts = tp_account_manager_get_valid_accounts (manager);
|
|
197 |
accounts = tp_account_manager_dup_valid_accounts (manager);
|
198 | 198 |
while (accounts != NULL)
|
199 | 199 |
{
|
200 | 200 |
TpAccount *account = accounts->data;
|
|
218 | 218 |
|
219 | 219 |
accounts = g_list_delete_link (accounts, accounts);
|
220 | 220 |
}
|
221 | |
g_list_free (accounts);
|
|
221 |
g_list_free_full (accounts, g_object_unref);
|
222 | 222 |
|
223 | 223 |
out:
|
224 | 224 |
tp_weak_ref_destroy (wr);
|