diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-30 09:23:35 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-10-31 22:52:10 -0300 |
commit | 25e26e0056c00bfb61f73a1ea4325257098c2c23 (patch) | |
tree | 98d891de4739c7802e7fec7bf801997f1c027dbe | |
parent | a8656ed50acecddafb1cb2f359ba0090154137fb (diff) | |
download | rneovim-25e26e0056c00bfb61f73a1ea4325257098c2c23.tar.gz rneovim-25e26e0056c00bfb61f73a1ea4325257098c2c23.tar.bz2 rneovim-25e26e0056c00bfb61f73a1ea4325257098c2c23.zip |
job: Close libuv handles when uv_spawn fails
Commit @709685b4612f4 removed the close_job_* calls when uv_spawn fails because
of memory errors when trying to cleanup unitialized {R,W}Stream instances, but
the uv_pipe_t instances must be closed because they are added to the event loop
queue by previous `uv_pipe_init()` calls
-rw-r--r-- | src/nvim/os/job.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/os/job.c b/src/nvim/os/job.c index f8ad6874c9..bbf8006ab6 100644 --- a/src/nvim/os/job.c +++ b/src/nvim/os/job.c @@ -215,6 +215,10 @@ Job *job_start(char **argv, // Spawn the job if (uv_spawn(uv_default_loop(), &job->proc, &job->proc_opts) != 0) { + uv_close((uv_handle_t *)&job->proc_stdin, NULL); + uv_close((uv_handle_t *)&job->proc_stdout, NULL); + uv_close((uv_handle_t *)&job->proc_stderr, NULL); + event_poll(0); *status = -1; return NULL; } |