Don't call CloseHandle() twice on Windows (as it causes crashes, or unexpected behavior). This would happen with the following test case:

ProcessHandle handle = Process.launch(...);
handle.kill();
Then as handle gets out of scope, ~ProcessHandle would call CloseHandle() on an already closed handle.
This commit is contained in:
Patrice Tarabbia
2013-05-01 06:41:45 -04:00
parent e06fec0e24
commit c59f8865ac
14 changed files with 67 additions and 33 deletions

View File

@@ -84,7 +84,7 @@ public:
Pipe* outPipe,
Pipe* errPipe,
const EnvImpl& env);
static void killImpl(const ProcessHandleImpl& handle);
static void killImpl(ProcessHandleImpl& handle);
static void killImpl(PIDImpl pid);
static void requestTerminationImpl(PIDImpl pid);