Commit dbfdd320 authored by François Grisez's avatar François Grisez
Browse files

Fix some memory leaks

parent 34e5de5f
......@@ -1569,7 +1569,6 @@ static void linphone_gtk_init_status_icon(void) {
linphone_status_icon_params_set_title(params, _("Linphone"));
linphone_status_icon_params_set_description(params, _("A video internet phone"));
linphone_status_icon_params_set_on_click_cb(params, handle_icon_click, NULL);
g_object_unref(G_OBJECT(menu));
if(linphone_status_icon_init(
(LinphoneStatusIconReadyCb)linphone_gtk_status_icon_initialised_cb,
......
......@@ -60,6 +60,7 @@ void linphone_status_icon_params_unref(LinphoneStatusIconParams *obj) {
if(obj->ref < 0) {
if(obj->title) g_free(obj->title);
if(obj->menu) g_object_unref(obj->menu);
if(obj->desc) g_free(obj->desc);
g_free(obj);
}
}
......@@ -78,7 +79,7 @@ void linphone_status_icon_params_set_description(LinphoneStatusIconParams *obj,
void linphone_status_icon_params_set_menu(LinphoneStatusIconParams *obj, GtkWidget *menu) {
if(obj->menu) g_object_unref(obj->menu);
if(menu) obj->menu = g_object_ref(menu);
if(menu) obj->menu = g_object_ref_sink(menu);
else obj->menu = NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment