Fixes to child process
authorBert Belder <bertbelder@gmail.com>
Mon, 20 Dec 2010 22:31:28 +0000 (23:31 +0100)
committerBert Belder <bertbelder@gmail.com>
Mon, 20 Dec 2010 22:51:32 +0000 (23:51 +0100)
src/node_child_process_win32.cc

index 749cd70..615b0da 100644 (file)
@@ -524,7 +524,6 @@ int ChildProcess::do_spawn(eio_req *req) {
       child->pid_ = GetProcessId(info.hProcess);
       child->did_start_ = true;
       watch(child);
-      LeaveCriticalSection(&child->info_lock_);
 
       // Not interesting
       CloseHandle(info.hThread);
@@ -534,8 +533,8 @@ int ChildProcess::do_spawn(eio_req *req) {
   }
 
   // kill_me set or process failed to start
-  notify_spawn_failure(child);
   LeaveCriticalSection(&child->info_lock_);
+  notify_spawn_failure(child);
 
   return 0;
 }