]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0554: GTK4: memory leak in free_menu() v9.2.0554
authorFoxe Chen <chen.foxe@gmail.com>
Thu, 28 May 2026 21:17:23 +0000 (21:17 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 28 May 2026 21:17:23 +0000 (21:17 +0000)
Problem:  GTK4: memory leak in free_menu()
Solution: Free the label (Foxe Chen)

closes: #20343

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

index 861d787112ec66256fedeeb4ce7f6b1d0c91d6cf..5fd83d80b5ff1fdaccffbe22cd56da4bd6a8d8e0 100644 (file)
@@ -1074,6 +1074,10 @@ free_menu(vimmenu_T **menup)
     // Also may rebuild a tearoff'ed menu
     if (gui.in_use)
        gui_mch_destroy_menu(menu);
+# ifdef USE_GTK4
+    // GTK4 uses "menu->label" for action name
+    vim_free((char_u *)menu->label);
+# endif
 #endif
 
     // Don't change *menup until after calling gui_mch_destroy_menu(). The
index b7f9b8ed35d6ece8ab856bd82f21cd1c36bfa448..9e5b5cc02402821f4c625128f0038def72428760 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    554,
 /**/
     553,
 /**/