]> code.delx.au - gnu-emacs/commitdiff
Prevent NS event loop being re-entered (bug#11049)
authorAlan Third <alan@idiocy.org>
Sat, 25 Jun 2016 23:10:50 +0000 (00:10 +0100)
committerAlan Third <alan@idiocy.org>
Thu, 7 Jul 2016 19:48:35 +0000 (20:48 +0100)
* nsterm.m (ns_read_socket, ns_select): Return -1 if already in event
loop instead of aborting.

src/nsterm.m

index bd477a491ff72a9524b4014568f571452f348ff5..a6160ed5b2a859faaf8f4efa831530a502e6286d 100644 (file)
@@ -4098,6 +4098,9 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
 
   NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_read_socket");
 
+  if (apploopnr > 0)
+    return -1; /* Already within event loop. */
+
 #ifdef HAVE_NATIVE_FS
   check_native_fs ();
 #endif
@@ -4182,6 +4185,9 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
 
   NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_select");
 
+  if (apploopnr > 0)
+    return -1; /* Already within event loop. */
+
 #ifdef HAVE_NATIVE_FS
   check_native_fs ();
 #endif