mirror of
https://github.com/neovim/neovim.git
synced 2025-11-11 13:05:37 +00:00
channel: Move mch_exit(0) call to a non-deferred event handler
Since `mch_exit` will re-enter event_poll, it is necessary to call it outside libuv event loop.
This commit is contained in:
@@ -600,11 +600,16 @@ static void close_channel(Channel *channel)
|
|||||||
if (handle) {
|
if (handle) {
|
||||||
uv_close(handle, close_cb);
|
uv_close(handle, close_cb);
|
||||||
} else {
|
} else {
|
||||||
mch_exit(0);
|
event_push((Event) { .handler = on_stdio_close }, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void on_stdio_close(Event e)
|
||||||
|
{
|
||||||
|
mch_exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
static void free_channel(Channel *channel)
|
static void free_channel(Channel *channel)
|
||||||
{
|
{
|
||||||
pmap_del(uint64_t)(channels, channel->id);
|
pmap_del(uint64_t)(channels, channel->id);
|
||||||
|
|||||||
Reference in New Issue
Block a user