forked from qt-creator/qt-creator
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:
@@ -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)
|
|||||||
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user