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>
This commit is contained in:
Joerg Bornemann
2014-04-11 08:48:57 +02:00
parent eb83338223
commit bc8e9ca14f

View File

@@ -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) {