# HG changeset patch # User Jason Rumney # Date 1213047804 0 # Node ID 7be18a0293631fdcb6ceab08cf110507e37a4262 # Parent 7bf8d633ec5098a56bfd4dcf1b85cc9f0d573ea6 (Fx_popup_menu): Unwind protect while building menu. diff -r 7bf8d633ec50 -r 7be18a029363 src/w32menu.c --- a/src/w32menu.c Mon Jun 09 17:07:18 2008 +0000 +++ b/src/w32menu.c Mon Jun 09 21:43:24 2008 +0000 @@ -188,6 +188,7 @@ Lisp_Object x, y, window; int keymaps = 0; int for_click = 0; + int specpdl_count = SPECPDL_INDEX (); struct gcpro gcpro1; #ifdef HAVE_MENUS @@ -271,6 +272,8 @@ Vmenu_updating_frame = Qnil; #endif /* HAVE_MENUS */ + record_unwind_protect (unuse_menu_items, Qnil); + title = Qnil; GCPRO1 (title); @@ -340,6 +343,8 @@ keymaps = 0; } + unbind_to (specpdl_count, Qnil); + if (NILP (position)) { discard_menu_items ();