summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2014-04-22 01:26:11 +0900
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-04-30 09:02:18 -0700
commitab7a3d098ddb13967014c723333c1df730da4940 (patch)
treec25e7e12cb759be8b5a647a5068d706b5a328d60 /src
parent26a1b712ec4e39cedc0b305165ce4660f47ba4d5 (diff)
downloadandroid-node-v8-ab7a3d098ddb13967014c723333c1df730da4940.tar.gz
android-node-v8-ab7a3d098ddb13967014c723333c1df730da4940.tar.bz2
android-node-v8-ab7a3d098ddb13967014c723333c1df730da4940.zip
child_process: fix assertion error in spawnSync
When ExitCallback was not called with an error such as ENOENT in uv_spawn, the process handle still remains refed and needs to be closed. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/spawn_sync.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc
index 481d0eff09..29de6862d5 100644
--- a/src/spawn_sync.cc
+++ b/src/spawn_sync.cc
@@ -511,6 +511,11 @@ void SyncProcessRunner::CloseHandlesAndDeleteLoop() {
if (uv_loop_ != NULL) {
CloseStdioPipes();
CloseKillTimer();
+ // Close the process handle when ExitCallback was not called.
+ uv_handle_t* uv_process_handle =
+ reinterpret_cast<uv_handle_t*>(&uv_process_);
+ if (!uv_is_closing(uv_process_handle))
+ uv_close(uv_process_handle, NULL);
// Give closing watchers a chance to finish closing and get their close
// callbacks called.