diff options
author | Alan Third <alan@idiocy.org> | 2016-06-26 00:10:50 +0100 |
---|---|---|
committer | Alan Third <alan@idiocy.org> | 2016-07-07 20:48:35 +0100 |
commit | ee7bc988603ca16e6ef37fbbc377d82db37954c0 (patch) | |
tree | 8f0da119b0c399c634333eefe1a6a17048f1cd8a | |
parent | 5508f06f3283b4129cd70340a58ba608cc810d4e (diff) |
Prevent NS event loop being re-entered (bug#11049)
* nsterm.m (ns_read_socket, ns_select): Return -1 if already in event
loop instead of aborting.
-rw-r--r-- | src/nsterm.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index bd477a491f..a6160ed5b2 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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 |