mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
process_close(): uv_unref() detached processes (#7539)
Doc for UV_PROCESS_DETACHED in uv.h mentions: > child process will still keep the parent's event loop alive unless > the parent process calls uv_unref() on the child's process handle. ref #3944
This commit is contained in:
parent
b6a603fe51
commit
881f9e42d1
@ -38,7 +38,7 @@ int libuv_process_spawn(LibuvProcess *uvproc)
|
|||||||
#endif
|
#endif
|
||||||
uvproc->uvopts.exit_cb = exit_cb;
|
uvproc->uvopts.exit_cb = exit_cb;
|
||||||
uvproc->uvopts.cwd = proc->cwd;
|
uvproc->uvopts.cwd = proc->cwd;
|
||||||
uvproc->uvopts.env = NULL;
|
uvproc->uvopts.env = NULL; // Inherits the parent (nvim) env.
|
||||||
uvproc->uvopts.stdio = uvproc->uvstdio;
|
uvproc->uvopts.stdio = uvproc->uvstdio;
|
||||||
uvproc->uvopts.stdio_count = 3;
|
uvproc->uvopts.stdio_count = 3;
|
||||||
uvproc->uvstdio[0].flags = UV_IGNORE;
|
uvproc->uvstdio[0].flags = UV_IGNORE;
|
||||||
|
@ -324,6 +324,13 @@ static void process_close(Process *proc)
|
|||||||
}
|
}
|
||||||
assert(!proc->closed);
|
assert(!proc->closed);
|
||||||
proc->closed = true;
|
proc->closed = true;
|
||||||
|
|
||||||
|
if (proc->detach) {
|
||||||
|
if (proc->type == kProcessTypeUv) {
|
||||||
|
uv_unref((uv_handle_t *)&(((LibuvProcess *)proc)->uv));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (proc->type) {
|
switch (proc->type) {
|
||||||
case kProcessTypeUv:
|
case kProcessTypeUv:
|
||||||
libuv_process_close((LibuvProcess *)proc);
|
libuv_process_close((LibuvProcess *)proc);
|
||||||
|
Loading…
Reference in New Issue
Block a user