diff --git a/src/nsterm.m b/src/nsterm.m index f2b0d90..10e22fd 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -288,7 +288,6 @@ - (NSColor *)colorUsingDefaultColorSpace static struct timespec select_timeout = { 0, 0 }; static int selfds[2] = { -1, -1 }; static pthread_mutex_t select_mutex; -static int apploopnr = 0; static NSAutoreleasePool *outerpool; static struct input_event *emacs_event = NULL; static struct input_event *q_event_ptr = NULL; @@ -4054,15 +4053,6 @@ in certain situations (rapid incoming events). } #endif /* NS_IMPL_COCOA */ -static void -unwind_apploopnr (Lisp_Object not_used) -{ - --apploopnr; - n_emacs_events_pending = 0; - ns_finish_events (); - q_event_ptr = NULL; -} - static int ns_read_socket (struct terminal *terminal, struct input_event *hold_quit) /* -------------------------------------------------------------------------- @@ -4126,13 +4116,8 @@ in certain situations (rapid incoming events). send_appdefined = YES; ns_send_appdefined (-1); - if (++apploopnr != 1) - { - emacs_abort (); - } - record_unwind_protect (unwind_apploopnr, Qt); [NSApp run]; - unbind_to (specpdl_count, Qnil); /* calls unwind_apploopnr */ + unbind_to (specpdl_count, Qnil); } nevents = n_emacs_events_pending; @@ -4235,16 +4220,10 @@ in certain situations (rapid incoming events). block_input (); ns_init_events (&event); - if (++apploopnr != 1) - { - emacs_abort (); - } - { ptrdiff_t specpdl_count = SPECPDL_INDEX (); - record_unwind_protect (unwind_apploopnr, Qt); [NSApp run]; - unbind_to (specpdl_count, Qnil); /* calls unwind_apploopnr */ + unbind_to (specpdl_count, Qnil); } ns_finish_events ();