changeset 95723:7be18a029363

(Fx_popup_menu): Unwind protect while building menu.
author Jason Rumney <jasonr@gnu.org>
date Mon, 09 Jun 2008 21:43:24 +0000
parents 7bf8d633ec50
children fca71dfe5c5e
files src/w32menu.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ();