diff options
| author | Glenn Morris | 2011-11-06 15:38:01 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-11-06 15:38:01 -0800 |
| commit | a64bfdfa5a90731b804c057f2bcc74a8ba02937c (patch) | |
| tree | bbada374e4b0d10b3b25fb51b80df0969ce79ff8 /src | |
| parent | cb41b32a2325b0bd6e12d62cc82f2bc6dd00047a (diff) | |
| parent | ba24cea25940796868dc0d1a6752f9279613b3d7 (diff) | |
| download | emacs-a64bfdfa5a90731b804c057f2bcc74a8ba02937c.tar.gz emacs-a64bfdfa5a90731b804c057f2bcc74a8ba02937c.zip | |
Merge from emacs-23; up to 2010-06-22T07:41:10Z!rgm@gnu.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xmenu.c | 31 |
2 files changed, 33 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4074ee4e924..f174eeff623 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * xmenu.c (cleanup_widget_value_tree): New function. | ||
| 4 | (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of | ||
| 5 | calling free_menubar_widget_value_tree directly (Bug#9830). | ||
| 6 | |||
| 1 | 2011-11-06 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2011-11-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | Fix some portability problems with 'inline'. | 9 | Fix some portability problems with 'inline'. |
diff --git a/src/xmenu.c b/src/xmenu.c index 7fcd2ad3724..0dd652b566d 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1604,6 +1604,17 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, | |||
| 1604 | 1604 | ||
| 1605 | #endif /* not USE_GTK */ | 1605 | #endif /* not USE_GTK */ |
| 1606 | 1606 | ||
| 1607 | static Lisp_Object | ||
| 1608 | cleanup_widget_value_tree (Lisp_Object arg) | ||
| 1609 | { | ||
| 1610 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | ||
| 1611 | widget_value *wv = p->pointer; | ||
| 1612 | |||
| 1613 | free_menubar_widget_value_tree (wv); | ||
| 1614 | |||
| 1615 | return Qnil; | ||
| 1616 | } | ||
| 1617 | |||
| 1607 | Lisp_Object | 1618 | Lisp_Object |
| 1608 | xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | 1619 | xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, |
| 1609 | Lisp_Object title, const char **error_name, Time timestamp) | 1620 | Lisp_Object title, const char **error_name, Time timestamp) |
| @@ -1618,6 +1629,8 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 1618 | 1629 | ||
| 1619 | int first_pane; | 1630 | int first_pane; |
| 1620 | 1631 | ||
| 1632 | int specpdl_count = SPECPDL_INDEX (); | ||
| 1633 | |||
| 1621 | if (! FRAME_X_P (f)) | 1634 | if (! FRAME_X_P (f)) |
| 1622 | abort (); | 1635 | abort (); |
| 1623 | 1636 | ||
| @@ -1812,11 +1825,15 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 1812 | /* No selection has been chosen yet. */ | 1825 | /* No selection has been chosen yet. */ |
| 1813 | menu_item_selection = 0; | 1826 | menu_item_selection = 0; |
| 1814 | 1827 | ||
| 1828 | /* Make sure to free the widget_value objects we used to specify the | ||
| 1829 | contents even with longjmp. */ | ||
| 1830 | record_unwind_protect (cleanup_widget_value_tree, | ||
| 1831 | make_save_value (first_wv, 0)); | ||
| 1832 | |||
| 1815 | /* Actually create and show the menu until popped down. */ | 1833 | /* Actually create and show the menu until popped down. */ |
| 1816 | create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp); | 1834 | create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp); |
| 1817 | 1835 | ||
| 1818 | /* Free the widget_value objects we used to specify the contents. */ | 1836 | unbind_to (specpdl_count, Qnil); |
| 1819 | free_menubar_widget_value_tree (first_wv); | ||
| 1820 | 1837 | ||
| 1821 | /* Find the selected item, and its pane, to return | 1838 | /* Find the selected item, and its pane, to return |
| 1822 | the proper value. */ | 1839 | the proper value. */ |
| @@ -2003,6 +2020,8 @@ xdialog_show (FRAME_PTR f, | |||
| 2003 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ | 2020 | /* 1 means we've seen the boundary between left-hand elts and right-hand. */ |
| 2004 | int boundary_seen = 0; | 2021 | int boundary_seen = 0; |
| 2005 | 2022 | ||
| 2023 | int specpdl_count = SPECPDL_INDEX (); | ||
| 2024 | |||
| 2006 | if (! FRAME_X_P (f)) | 2025 | if (! FRAME_X_P (f)) |
| 2007 | abort (); | 2026 | abort (); |
| 2008 | 2027 | ||
| @@ -2116,11 +2135,15 @@ xdialog_show (FRAME_PTR f, | |||
| 2116 | /* No selection has been chosen yet. */ | 2135 | /* No selection has been chosen yet. */ |
| 2117 | menu_item_selection = 0; | 2136 | menu_item_selection = 0; |
| 2118 | 2137 | ||
| 2138 | /* Make sure to free the widget_value objects we used to specify the | ||
| 2139 | contents even with longjmp. */ | ||
| 2140 | record_unwind_protect (cleanup_widget_value_tree, | ||
| 2141 | make_save_value (first_wv, 0)); | ||
| 2142 | |||
| 2119 | /* Actually create and show the dialog. */ | 2143 | /* Actually create and show the dialog. */ |
| 2120 | create_and_show_dialog (f, first_wv); | 2144 | create_and_show_dialog (f, first_wv); |
| 2121 | 2145 | ||
| 2122 | /* Free the widget_value objects we used to specify the contents. */ | 2146 | unbind_to (specpdl_count, Qnil); |
| 2123 | free_menubar_widget_value_tree (first_wv); | ||
| 2124 | 2147 | ||
| 2125 | /* Find the selected item, and its pane, to return | 2148 | /* Find the selected item, and its pane, to return |
| 2126 | the proper value. */ | 2149 | the proper value. */ |