aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/process_ctrlc_stub.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-04-11 08:48:57 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-04-11 10:36:30 +0200
commitbc8e9ca14f12c76f43f322ad6a266b92c23ca21f (patch)
tree5e20009423db9587ad5f1663263240ad940b08ef /src/libs/utils/process_ctrlc_stub.cpp
parenteb833382230a5fd6638fca303be722e4564bf30e (diff)
process_ctrlc_stub: close process and thread handles
There's no need to keep those handles open throughout the lifetime of the stub. Change-Id: I27dd1f26edc1ccd150b913a7f38bab70d8b10763 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/libs/utils/process_ctrlc_stub.cpp')
-rw-r--r--src/libs/utils/process_ctrlc_stub.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/utils/process_ctrlc_stub.cpp b/src/libs/utils/process_ctrlc_stub.cpp
index 6f6905f931..f4179f267e 100644
--- a/src/libs/utils/process_ctrlc_stub.cpp
+++ b/src/libs/utils/process_ctrlc_stub.cpp
@@ -165,6 +165,7 @@ DWORD WINAPI processWatcherThread(LPVOID lpParameter)
DWORD dwExitCode;
if (!GetExitCodeProcess(hProcess, &dwExitCode))
dwExitCode = -1;
+ CloseHandle(hProcess);
PostMessage(hwndMain, WM_DESTROY, dwExitCode, 0);
return 0;
}
@@ -185,6 +186,7 @@ bool startProcess(wchar_t *pCommandLine)
fwprintf(stderr, L"qtcreator_ctrlc_stub: Command line failed: %s\n", pCommandLine);
return false;
}
+ CloseHandle(pi.hThread);
HANDLE hThread = CreateThread(NULL, 0, processWatcherThread, reinterpret_cast<void*>(pi.hProcess), 0, NULL);
if (!hThread) {