]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0822: GTK4: crash menu id is null in gui_mch_destroy_menu() v9.2.0822
authorFoxe Chen <chen.foxe@gmail.com>
Tue, 21 Jul 2026 16:23:32 +0000 (16:23 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 21 Jul 2026 16:23:32 +0000 (16:23 +0000)
Problem:  GTK4: crash menu id is null in gui_mch_destroy_menu()
Solution: Check that menu->id is not null before calling
          vim_menu_remove() (Foxe Chen).

closes: #20724

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui_gtk4.c
src/version.c

index fbe4ec55356f129a0acb19426767439778e2c790..a194edd76099bbb406d2333b9a7e216ea0992da1 100644 (file)
@@ -4844,7 +4844,8 @@ gui_mch_destroy_menu(vimmenu_T *menu)
     else if (menu->parent == NULL)
        // Remove from menubar
        vim_menu_bar_remove(VIM_MENU_BAR(gui.menubar), menu->id);
-    else
+    // "menu->id" is NULL for window toolbar
+    else if (menu->id != NULL)
        // Remove from parent menu
        vim_menu_remove(VIM_MENU(menu->parent->submenu_id), menu->id);
 
index 5d8f6e9aa27ab1256f7519e609e0fbc384916761..267d273de16a7106f294503b511a4ea1492db4a0 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    822,
 /**/
     821,
 /**/