From 62555c22ca24836f41a0973236cfd0f83b4d5532 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 26 Nov 1995 20:50:52 +0000 Subject: [PATCH] (set_frame_menubar): When called with deep_p == 0, that invalidates the previous f->menu_bar_vector. --- src/xmenu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xmenu.c b/src/xmenu.c index 8fd87175a14..95aa47bccaa 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1654,7 +1654,7 @@ set_frame_menubar (f, first_time, deep_p) if (menu_items_used == i || (previous_items[i] != XVECTOR (menu_items)->contents[i])) break; - if (i == menu_items_used && i == previous_menu_items_used) + if (i == menu_items_used && i == previous_menu_items_used && i != 0) { free_menubar_widget_value_tree (first_wv); menu_items = Qnil; @@ -1704,6 +1704,11 @@ set_frame_menubar (f, first_time, deep_p) first_wv->contents = wv; prev_wv = wv; } + + /* Forget what we thought we knew about what is in the + detailed contents of the menu bar menus. + Changing the top level always destroys the contents. */ + f->menu_bar_items_used = 0; } /* Create or update the menu bar widget. */ -- 2.39.2