Codebase list empathy / 6a5b51b
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
23 changed file(s) with 58 addition(s) and 55 deletion(s). Raw diff Collapse all Expand all
187187 goto out;
188188 }
189189
190 accounts = tp_account_manager_get_valid_accounts (self->priv->mgr);
190 accounts = tp_account_manager_dup_valid_accounts (self->priv->mgr);
191191 for (l = accounts; l != NULL; l = g_list_next (l))
192192 {
193193 TpAccount *account = l->data;
198198 tp_g_signal_connect_object (self->priv->mgr, "account-validity-changed",
199199 G_CALLBACK (account_validity_changed_cb), self, 0);
200200
201 g_list_free (accounts);
201 g_list_free_full (accounts, g_object_unref);
202202
203203 out:
204204 g_object_unref (self);
432432 most_available_presence_changed (account_manager, state, status,
433433 status_message, self);
434434
435 accounts = tp_account_manager_get_valid_accounts (self->priv->manager);
435 accounts = tp_account_manager_dup_valid_accounts (self->priv->manager);
436436 for (l = accounts; l != NULL; l = l->next)
437437 {
438438 tp_g_signal_connect_object (l->data, "status-changed",
439439 G_CALLBACK (account_status_changed_cb), self, 0);
440440 }
441 g_list_free (accounts);
441 g_list_free_full (accounts, g_object_unref);
442442
443443 g_free (status);
444444 g_free (status_message);
566566 TP_ACCOUNT_MANAGER_FEATURE_CORE)))
567567 g_critical (G_STRLOC ": %s called before AccountManager ready", G_STRFUNC);
568568
569 accounts = tp_account_manager_get_valid_accounts (manager);
569 accounts = tp_account_manager_dup_valid_accounts (manager);
570570
571571 for (l = accounts; l != NULL; l = l->next)
572572 {
582582 break;
583583 }
584584
585 g_list_free (accounts);
585 g_list_free_full (accounts, g_object_unref);
586586 g_object_unref (manager);
587587
588588 if (connecting != NULL)
279279 return;
280280 }
281281
282 accounts = tp_account_manager_get_valid_accounts (manager);
282 accounts = tp_account_manager_dup_valid_accounts (manager);
283283
284284 for (l = accounts; l != NULL; l = l->next)
285285 {
300300 self, 0);
301301 }
302302
303 g_list_free (accounts);
303 g_list_free_full (accounts, g_object_unref);
304304
305305 if (self->priv->select_when_ready != NULL)
306306 {
35173517 return;
35183518 }
35193519
3520 accounts = tp_account_manager_get_valid_accounts (account_manager);
3520 accounts = tp_account_manager_dup_valid_accounts (account_manager);
35213521
35223522 for (l = accounts; l != NULL; l = l->next) {
35233523 TpAccount *account = l->data;
35263526 chat, 0);
35273527 }
35283528
3529 g_list_free (accounts);
3529 g_list_free_full (accounts, g_object_unref);
35303530 }
35313531
35323532 static void
233233 return;
234234 }
235235
236 accounts = tp_account_manager_get_valid_accounts (TP_ACCOUNT_MANAGER (am));
236 accounts = tp_account_manager_dup_valid_accounts (TP_ACCOUNT_MANAGER (am));
237237
238238 for (ptr = accounts; ptr != NULL; ptr = ptr->next)
239239 {
246246 contact_blocking_dialog_refilter_account_chooser (self);
247247 }
248248
249 g_list_free (accounts);
249 g_list_free_full (accounts, g_object_unref);
250250 }
251251
252252 static void
282282 self->priv->add_temp_ctx = add_temporary_individual_ctx_new (self);
283283
284284 /* 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);
286286 for (l = accounts; l != NULL; l = g_list_next (l))
287287 {
288288 TpAccount *account = l->data;
302302 g_object_unref (factory);
303303 }
304304
305 g_list_free (accounts);
305 g_list_free_full (accounts, g_object_unref);
306306 }
307307
308308 static void
287287 am = tp_account_manager_dup ();
288288 g_return_val_if_fail (am != NULL, NULL);
289289
290 accounts = tp_account_manager_get_valid_accounts (am);
290 accounts = tp_account_manager_dup_valid_accounts (am);
291291 for (l = accounts; l != NULL; l = g_list_next (l))
292292 {
293293 TpAccount *account = l->data;
302302 found = g_list_prepend (found, g_object_ref (account));
303303 }
304304
305 g_list_free (accounts);
305 g_list_free_full (accounts, g_object_unref);
306306 g_object_unref (am);
307307
308308 return found;
222222 gboolean salut_created = FALSE;
223223 GList *accounts, *l;
224224
225 accounts = tp_account_manager_get_valid_accounts (manager);
225 accounts = tp_account_manager_dup_valid_accounts (manager);
226226
227227 for (l = accounts; l != NULL; l = g_list_next (l))
228228 {
235235 }
236236 }
237237
238 g_list_free (accounts);
238 g_list_free_full (accounts, g_object_unref);
239239
240240 return !salut_created;
241241 }
188188 goto out;
189189 }
190190
191 accounts = tp_account_manager_get_valid_accounts (manager);
191 accounts = tp_account_manager_dup_valid_accounts (manager);
192192 for (l = accounts; l; l = l->next)
193193 {
194194 TpConnection *conn = tp_account_get_connection (TP_ACCOUNT (l->data));
196196 if (conn != NULL)
197197 publish_location (data->self, conn, data->force_publication);
198198 }
199 g_list_free (accounts);
199 g_list_free_full (accounts, g_object_unref);
200200
201201 out:
202202 g_object_unref (data->self);
674674 return;
675675 }
676676
677 accounts = tp_account_manager_get_valid_accounts (account_manager);
677 accounts = tp_account_manager_dup_valid_accounts (account_manager);
678678 for (l = accounts; l != NULL; l = l->next)
679679 {
680680 TpAccount *account = TP_ACCOUNT (l->data);
682682 tp_g_signal_connect_object (account, "status-changed",
683683 G_CALLBACK (new_connection_cb), self, 0);
684684 }
685 g_list_free (accounts);
685 g_list_free_full (accounts, g_object_unref);
686686 }
687687
688688 static void
24982498 GList *accounts, *l;
24992499
25002500 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);
25022502
25032503 for (l = accounts; l != NULL; l = l->next)
25042504 {
25092509 get_entities_for_account, ctx);
25102510 }
25112511
2512 g_list_free (accounts);
2512 g_list_free_full (accounts, g_object_unref);
25132513 }
25142514 _tpl_action_chain_append (self->priv->chain, select_first_entity, self);
25152515 _tpl_action_chain_start (self->priv->chain);
758758 return;
759759 }
760760
761 accounts = tp_account_manager_get_valid_accounts (manager);
761 accounts = tp_account_manager_dup_valid_accounts (manager);
762762
763763 for (l = accounts ; l != NULL ; l = g_list_next (l)) {
764764 TpAccount *a = TP_ACCOUNT (l->data);
769769 }
770770 }
771771
772 g_list_free (accounts);
772 g_list_free_full (accounts, g_object_unref);
773773
774774 if (!g_network_monitor_get_network_available (priv->connectivity))
775775 sensitive = FALSE;
5050 gboolean ret = FALSE;
5151 GList *accounts, *l;
5252
53 accounts = tp_account_manager_get_valid_accounts (manager);
53 accounts = tp_account_manager_dup_valid_accounts (manager);
5454
5555 for (l = accounts ; l != NULL; l = g_list_next (l))
5656 {
6161 }
6262 }
6363
64 g_list_free (accounts);
64 g_list_free_full (accounts, g_object_unref);
6565
6666 return ret;
6767 }
7272 GList *accounts;
7373 gboolean has_accounts;
7474
75 accounts = tp_account_manager_get_valid_accounts (manager);
75 accounts = tp_account_manager_dup_valid_accounts (manager);
7676 has_accounts = (accounts != NULL);
77 g_list_free (accounts);
77 g_list_free_full (accounts, g_object_unref);
7878
7979 return has_accounts;
8080 }
21982198 dialog);
21992199
22002200 /* 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);
22022202 for (l = accounts; l; l = l->next)
22032203 {
22042204 accounts_dialog_add_account (dialog, l->data);
22052205 }
2206 g_list_free (accounts);
2206 g_list_free_full (accounts, g_object_unref);
22072207
22082208 priv->cms = empathy_connection_managers_dup_singleton ();
22092209
7676 GList *accounts, *l;
7777 TpAccount *found = NULL;
7878
79 accounts = tp_account_manager_get_valid_accounts (mgr);
79 accounts = tp_account_manager_dup_valid_accounts (mgr);
8080 for (l = accounts; l != NULL; l = g_list_next (l))
8181 {
8282 if (!tp_strdiff (tp_proxy_get_object_path (l->data), path))
8686 }
8787 }
8888
89 g_list_free (accounts);
89 g_list_free_full (accounts, g_object_unref);
9090 return found;
9191 }
9292
794794 GList *accounts, *ptr;
795795 char *retval;
796796
797 accounts = tp_account_manager_get_valid_accounts (self->priv->am);
797 accounts = tp_account_manager_dup_valid_accounts (self->priv->am);
798798
799799 for (ptr = accounts; ptr != NULL; ptr = ptr->next)
800800 {
808808 }
809809 }
810810
811 g_list_free (accounts);
811 g_list_free_full (accounts, g_object_unref);
812812
813813 if (g_hash_table_size (protocols) > 0)
814814 {
122122
123123 value = g_hash_table_lookup (data->settings, "account");
124124
125 accounts = tp_account_manager_get_valid_accounts (manager);
125 accounts = tp_account_manager_dup_valid_accounts (manager);
126126
127127 /* Only set the "Import" cell to be active if there isn't already an
128128 * account set up with the same account id. */
129129 import = !import_widget_account_id_in_list (accounts,
130130 g_value_get_string (value));
131131
132 g_list_free (accounts);
132 g_list_free_full (accounts, g_object_unref);
133133
134134 gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, -1,
135135 COL_IMPORT, import,
15061506
15071507 gtk_spinner_stop (GTK_SPINNER (self->priv->spinner_loading));
15081508
1509 accounts = tp_account_manager_get_valid_accounts (
1509 accounts = tp_account_manager_dup_valid_accounts (
15101510 self->priv->account_manager);
15111511
15121512 len = g_list_length (accounts);
15591559 display_page_contact_list (self);
15601560
15611561 out:
1562 g_list_free (accounts);
1562 g_list_free_full (accounts, g_object_unref);
15631563 }
15641564
15651565 static void
16351635 return;
16361636 }
16371637
1638 accounts = tp_account_manager_get_valid_accounts (self->priv->account_manager);
1638 accounts = tp_account_manager_dup_valid_accounts (
1639 self->priv->account_manager);
16391640 for (j = accounts; j != NULL; j = j->next)
16401641 {
16411642 TpAccount *account = TP_ACCOUNT (j->data);
16541655
16551656 set_notebook_page (self);
16561657
1657 g_list_free (accounts);
1658 g_list_free_full (accounts, g_object_unref);
16581659 }
16591660
16601661 void
125125 {
126126 GList *accounts, *l;
127127
128 accounts = tp_account_manager_get_valid_accounts (am);
128 accounts = tp_account_manager_dup_valid_accounts (am);
129129 for (l = accounts; l != NULL; l = g_list_next (l))
130130 {
131131 TpAccount *account = l->data;
156156 g_hash_table_unref (params);
157157 }
158158
159 g_list_free (accounts);
159 g_list_free_full (accounts, g_object_unref);
160160 }
161161
162162 static void
164164 {
165165 GList *accounts, *l;
166166
167 accounts = tp_account_manager_get_valid_accounts (am);
167 accounts = tp_account_manager_dup_valid_accounts (am);
168168 for (l = accounts; l != NULL; l = g_list_next (l))
169169 {
170170 TpAccount *account = l->data;
196196 g_hash_table_unref (params);
197197 }
198198
199 g_list_free (accounts);
199 g_list_free_full (accounts, g_object_unref);
200200 }
201201
202202 static void
539539
540540 manager = empathy_uoa_manager_dup ();
541541
542 accounts = tp_account_manager_get_valid_accounts (ctx->am);
542 accounts = tp_account_manager_dup_valid_accounts (ctx->am);
543543 for (l = accounts; l != NULL; l = g_list_next (l))
544544 {
545545 TpAccount *account = l->data;
560560
561561 migrate_account_to_uoa (ctx->am, account);
562562 }
563
564 g_list_free_full (accounts, g_object_unref);
563565
564566 g_object_unref (manager);
565567 }
444444 return;
445445 }
446446
447 list = tp_account_manager_get_valid_accounts (account_manager);
447 list = tp_account_manager_dup_valid_accounts (account_manager);
448448 for (l = list; l != NULL; l = l->next) {
449449 tp_g_signal_connect_object (l->data, "status-changed",
450450 G_CALLBACK (status_icon_status_changed_cb),
451451 icon, 0);
452452 }
453 g_list_free (list);
453 g_list_free_full (list, g_object_unref);
454454
455455 status_icon_presence_changed_cb (icon);
456456 }
708708 return;
709709 }
710710
711 accounts = tp_account_manager_get_valid_accounts (account_manager);
711 accounts = tp_account_manager_dup_valid_accounts (account_manager);
712712
713713 for (l = accounts; l != NULL; l = g_list_next (l))
714714 {
721721 tp_g_signal_connect_object (account, "notify::connection",
722722 G_CALLBACK (account_connection_changed_cb), chatroom_manager, 0);
723723 }
724 g_list_free (accounts);
724 g_list_free_full (accounts, g_object_unref);
725725 }
726726
727727 static void
309309 goto out;
310310 }
311311
312 accounts = tp_account_manager_get_valid_accounts (manager);
312 accounts = tp_account_manager_dup_valid_accounts (manager);
313313 while (accounts != NULL)
314314 {
315315 TpAccount *account = accounts->data;
327327
328328 accounts = g_list_delete_link (accounts, accounts);
329329 }
330 g_list_free (accounts);
330 g_list_free_full (accounts, g_object_unref);
331331
332332 out:
333333 tp_weak_ref_destroy (wr);
194194 goto out;
195195 }
196196
197 accounts = tp_account_manager_get_valid_accounts (manager);
197 accounts = tp_account_manager_dup_valid_accounts (manager);
198198 while (accounts != NULL)
199199 {
200200 TpAccount *account = accounts->data;
218218
219219 accounts = g_list_delete_link (accounts, accounts);
220220 }
221 g_list_free (accounts);
221 g_list_free_full (accounts, g_object_unref);
222222
223223 out:
224224 tp_weak_ref_destroy (wr);