Commit 9e10935d authored by Sébastien Wilmet's avatar Sébastien Wilmet

Do not leak the GeditNotebookPopupMenu's

parent c8b21d43
......@@ -1536,6 +1536,8 @@ row_on_button_pressed (GtkWidget *row_event_box,
GeditTab *tab = GEDIT_TAB (document_row->ref);
GtkWidget *menu = gedit_notebook_popup_menu_new (window, tab);
g_object_ref_sink (menu);
gtk_menu_popup_for_device (GTK_MENU (menu),
gdk_event_get_device ((GdkEvent *)event),
NULL, NULL,
......@@ -1543,6 +1545,8 @@ row_on_button_pressed (GtkWidget *row_event_box,
event->button,
event->time);
g_object_unref (menu);
return TRUE;
}
}
......
......@@ -2213,14 +2213,20 @@ on_show_popup_menu (GeditMultiNotebook *multi,
GtkWidget *menu;
if (event == NULL)
{
return;
}
menu = gedit_notebook_popup_menu_new (window, tab);
gtk_widget_show (menu);
g_object_ref_sink (menu);
gtk_widget_show (menu);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
NULL, NULL,
event->button, event->time);
g_object_unref (menu);
}
static void
......
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