File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -613,6 +613,17 @@ gui_mch_menu_set_tip(vimmenu_T *menu)
613613 void
614614gui_mch_destroy_menu (vimmenu_T * menu )
615615{
616+ /* Don't let gtk_container_remove automatically destroy menu->id. */
617+ if (menu -> id != NULL )
618+ g_object_ref (menu -> id );
619+
620+ /* Workaround for a spurious gtk warning in Ubuntu: "Trying to remove
621+ * a child that doesn't believe we're it's parent."
622+ * Remove widget from gui.menubar before destroying it. */
623+ if (menu -> id != NULL && gui .menubar != NULL
624+ && gtk_widget_get_parent (menu -> id ) == gui .menubar )
625+ gtk_container_remove (GTK_CONTAINER (gui .menubar ), menu -> id );
626+
616627# ifdef FEAT_TOOLBAR
617628 if (menu -> parent != NULL && menu_is_toolbar (menu -> parent -> name ))
618629 {
@@ -632,6 +643,8 @@ gui_mch_destroy_menu(vimmenu_T *menu)
632643 gtk_widget_destroy (menu -> id );
633644 }
634645
646+ if (menu -> id != NULL )
647+ g_object_unref (menu -> id );
635648 menu -> submenu_id = NULL ;
636649 menu -> id = NULL ;
637650}
Original file line number Diff line number Diff line change @@ -728,6 +728,8 @@ static char *(features[]) =
728728
729729static int included_patches [] =
730730{ /* Add new patch number below this line */
731+ /**/
732+ 1289 ,
731733/**/
732734 1288 ,
733735/**/
You can’t perform that action at this time.
0 commit comments