fix a few memory leaks
This commit is contained in:
parent
623649dd86
commit
8718ef85a0
@ -296,7 +296,7 @@ void dc_account_set_friends(dc_account_t a, dc_account_t *friends, size_t len)
|
|||||||
|
|
||||||
g_ptr_array_remove_range(a->friends, 0, a->friends->len);
|
g_ptr_array_remove_range(a->friends, 0, a->friends->len);
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
g_ptr_array_add(a->friends, friends[i]);
|
g_ptr_array_add(a->friends, dc_ref(friends[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,9 @@ bool dc_api_get_friends(dc_api_t api, dc_account_t login)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
g_ptr_array_free(f, FALSE);
|
if (f != NULL) {
|
||||||
|
g_ptr_array_unref(f);
|
||||||
|
}
|
||||||
json_decref(reply);
|
json_decref(reply);
|
||||||
reply = NULL;
|
reply = NULL;
|
||||||
|
|
||||||
|
@ -57,8 +57,8 @@ bool ncdc_cmd_msg(ncdc_mainwindow_t n, size_t ac, wchar_t **av)
|
|||||||
v = ncdc_textview_new();
|
v = ncdc_textview_new();
|
||||||
goto_if_true(v == NULL, cleanup);
|
goto_if_true(v == NULL, cleanup);
|
||||||
|
|
||||||
ncdc_textview_set_account(v, dc_ref(current_account));
|
ncdc_textview_set_account(v, current_account);
|
||||||
ncdc_textview_set_channel(v, dc_ref(c));
|
ncdc_textview_set_channel(v, c);
|
||||||
|
|
||||||
g_ptr_array_add(ncdc_mainwindow_views(n), dc_ref(v));
|
g_ptr_array_add(ncdc_mainwindow_views(n), dc_ref(v));
|
||||||
ncdc_mainwindow_switchview(n, ncdc_mainwindow_views(n)->len-1);
|
ncdc_mainwindow_switchview(n, ncdc_mainwindow_views(n)->len-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user