patch 9.2.0554: GTK4: memory leak in free_menu()

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>
This commit is contained in:
Foxe Chen
2026-05-28 21:17:23 +00:00
committed by Christian Brabandt
parent 93d177cd2b
commit 81d42cf1aa
2 changed files with 6 additions and 0 deletions
+4
View 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
+2
View File
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
554,
/**/
553,
/**/