mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(mswin): UI may hang on exit
Problem:
On Windows, since b360c06085
, UI may hang on exit. #33019
Solution:
Restore the hack in on_proc_exit, until we can figure out why rpc_close
is not called in the UI client when the server closes the channel.
This commit is contained in:

committed by
Christian Clason

parent
c1ac55ba45
commit
d32780de4d
@@ -437,6 +437,17 @@ static void on_proc_exit(Proc *proc)
|
|||||||
Loop *loop = proc->loop;
|
Loop *loop = proc->loop;
|
||||||
ILOG("child exited: pid=%d status=%d" PRIu64, proc->pid, proc->status);
|
ILOG("child exited: pid=%d status=%d" PRIu64, proc->pid, proc->status);
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
// XXX: This assumes the TUI never spawns any other processes...?
|
||||||
|
// TODO(justinmk): figure out why rpc_close sometimes(??) isn't called, then remove this jank.
|
||||||
|
// Theories:
|
||||||
|
// - EOF not received in receive_msgpack, then doesn't call chan_close_on_err().
|
||||||
|
// - proc_close_handles not tickled by ui_client.c's LOOP_PROCESS_EVENTS?
|
||||||
|
if (ui_client_channel_id) {
|
||||||
|
exit_on_closed_chan(proc->status);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Process has terminated, but there could still be data to be read from the
|
// Process has terminated, but there could still be data to be read from the
|
||||||
// OS. We are still in the libuv loop, so we cannot call code that polls for
|
// OS. We are still in the libuv loop, so we cannot call code that polls for
|
||||||
// more data directly. Instead delay the reading after the libuv loop by
|
// more data directly. Instead delay the reading after the libuv loop by
|
||||||
|
Reference in New Issue
Block a user