Commit bc8e9ca1 authored by Joerg Bornemann's avatar Joerg Bornemann
Browse files

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: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent eb833382
...@@ -165,6 +165,7 @@ DWORD WINAPI processWatcherThread(LPVOID lpParameter) ...@@ -165,6 +165,7 @@ DWORD WINAPI processWatcherThread(LPVOID lpParameter)
DWORD dwExitCode; DWORD dwExitCode;
if (!GetExitCodeProcess(hProcess, &dwExitCode)) if (!GetExitCodeProcess(hProcess, &dwExitCode))
dwExitCode = -1; dwExitCode = -1;
CloseHandle(hProcess);
PostMessage(hwndMain, WM_DESTROY, dwExitCode, 0); PostMessage(hwndMain, WM_DESTROY, dwExitCode, 0);
return 0; return 0;
} }
...@@ -185,6 +186,7 @@ bool startProcess(wchar_t *pCommandLine) ...@@ -185,6 +186,7 @@ bool startProcess(wchar_t *pCommandLine)
fwprintf(stderr, L"qtcreator_ctrlc_stub: Command line failed: %s\n", pCommandLine); fwprintf(stderr, L"qtcreator_ctrlc_stub: Command line failed: %s\n", pCommandLine);
return false; return false;
} }
CloseHandle(pi.hThread);
HANDLE hThread = CreateThread(NULL, 0, processWatcherThread, reinterpret_cast<void*>(pi.hProcess), 0, NULL); HANDLE hThread = CreateThread(NULL, 0, processWatcherThread, reinterpret_cast<void*>(pi.hProcess), 0, NULL);
if (!hThread) { if (!hThread) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment