Commit: patch 9.2.0822: GTK4: crash menu id is null in gui_mch_destroy_menu()

0 views
Skip to first unread message

Christian Brabandt

unread,
12:30 PM (4 hours ago) 12:30 PM
to vim...@googlegroups.com
patch 9.2.0822: GTK4: crash menu id is null in gui_mch_destroy_menu()

Commit: https://github.com/vim/vim/commit/dbbd6f99e8fb0371a7b15c0cec4810b1918a6b10
Author: Foxe Chen <chen...@gmail.com>
Date: Tue Jul 21 16:23:32 2026 +0000

patch 9.2.0822: GTK4: crash menu id is null in gui_mch_destroy_menu()

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...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c
index fbe4ec553..a194edd76 100644
--- a/src/gui_gtk4.c
+++ b/src/gui_gtk4.c
@@ -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);

diff --git a/src/version.c b/src/version.c
index 5d8f6e9aa..267d273de 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 822,
/**/
821,
/**/
Reply all
Reply to author
Forward
0 new messages