mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-15 07:14:46 +02:00
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:
@@ -62,7 +62,8 @@ public:
|
||||
UInt32 id() const;
|
||||
HANDLE process() const;
|
||||
int wait() const;
|
||||
|
||||
void closeHandle();
|
||||
|
||||
private:
|
||||
HANDLE _hProcess;
|
||||
UInt32 _pid;
|
||||
@@ -89,7 +90,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);
|
||||
static std::string terminationEventName(PIDImpl pid);
|
||||
|
Reference in New Issue
Block a user