Remove separate pool for popup dialogs (bug#23856)
* src/nsmenu.m (pop_down_menu, ns_popup_dialog): Remove references to autorelease pool and Popdown_data struct.
This commit is contained in:
parent
001d88b62e
commit
02ca5db040
1 changed files with 4 additions and 20 deletions
24
src/nsmenu.m
24
src/nsmenu.m
|
@ -1420,29 +1420,19 @@ - (NSRect) frame
|
|||
|
||||
========================================================================== */
|
||||
|
||||
struct Popdown_data
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
EmacsDialogPanel *dialog;
|
||||
};
|
||||
|
||||
static void
|
||||
pop_down_menu (void *arg)
|
||||
{
|
||||
struct Popdown_data *unwind_data = arg;
|
||||
EmacsDialogPanel *panel = arg;
|
||||
|
||||
block_input ();
|
||||
if (popup_activated_flag)
|
||||
{
|
||||
EmacsDialogPanel *panel = unwind_data->dialog;
|
||||
block_input ();
|
||||
popup_activated_flag = 0;
|
||||
[panel close];
|
||||
[unwind_data->pool release];
|
||||
[[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
|
||||
unblock_input ();
|
||||
}
|
||||
|
||||
xfree (unwind_data);
|
||||
unblock_input ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1453,7 +1443,6 @@ - (NSRect) frame
|
|||
Lisp_Object tem, title;
|
||||
NSPoint p;
|
||||
BOOL isQ;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
NSTRACE ("ns_popup_dialog");
|
||||
|
||||
|
@ -1473,18 +1462,13 @@ - (NSRect) frame
|
|||
contents = list2 (title, Fcons (build_string ("Ok"), Qt));
|
||||
|
||||
block_input ();
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
dialog = [[EmacsDialogPanel alloc] initFromContents: contents
|
||||
isQuestion: isQ];
|
||||
|
||||
{
|
||||
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
|
||||
struct Popdown_data *unwind_data = xmalloc (sizeof (*unwind_data));
|
||||
|
||||
unwind_data->pool = pool;
|
||||
unwind_data->dialog = dialog;
|
||||
|
||||
record_unwind_protect_ptr (pop_down_menu, unwind_data);
|
||||
record_unwind_protect_ptr (pop_down_menu, dialog);
|
||||
popup_activated_flag = 1;
|
||||
tem = [dialog runDialogAt: p];
|
||||
unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */
|
||||
|
|
Loading…
Add table
Reference in a new issue