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
Nicolas Hake 2016-02-08 16:41:27 +01:00
parent 3d9b322f51
commit d5dbcb71da
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}