forked from Mirrors/openclonk
ShowGfxErrorDialog: Fix handle leak
CreateProcessW will return a handle the main thread and a process handle to the child process. These handles must be closed to avoid a resource leak.liquid_container
parent
3d9b322f51
commit
d5dbcb71da
|
@ -116,8 +116,12 @@ static INT_PTR CALLBACK GfxErrProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPAR
|
|||
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
|
||||
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
|
||||
siStartupInfo.cb = sizeof(siStartupInfo);
|
||||
CreateProcessW(selfpath, NULL,
|
||||
NULL, NULL, FALSE, 0, NULL, Config.General.ExePath.GetWideChar(), &siStartupInfo, &piProcessInfo);
|
||||
if (CreateProcessW(selfpath, NULL,
|
||||
NULL, NULL, FALSE, 0, NULL, Config.General.ExePath.GetWideChar(), &siStartupInfo, &piProcessInfo))
|
||||
{
|
||||
CloseHandle(piProcessInfo.hProcess);
|
||||
CloseHandle(piProcessInfo.hThread);
|
||||
}
|
||||
EndDialog(hWnd,2);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue