mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
process.c: Close events are processed too late
Compiling with macro -DEXITFREE opens a code path on which the event loop is used after it was teared down, because not all close events were processed yet.
This commit is contained in:
@@ -126,8 +126,10 @@ void process_teardown(Loop *loop) FUNC_ATTR_NONNULL_ALL
|
||||
}
|
||||
}
|
||||
|
||||
// Wait until all children exit
|
||||
LOOP_PROCESS_EVENTS_UNTIL(loop, loop->events, -1, kl_empty(loop->children));
|
||||
// Wait until all children exit and all close events are processed.
|
||||
LOOP_PROCESS_EVENTS_UNTIL(
|
||||
loop, loop->events, -1,
|
||||
kl_empty(loop->children) && queue_empty(loop->events));
|
||||
pty_process_teardown(loop);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user