Skip to content

Commit

Permalink
WinUpdater: Properly account for failure in WaitForPID
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePLMonster committed Jul 22, 2019
1 parent d355aba commit a00dfee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/WinUpdater/WinUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ void Sleep(int sleep)
void WaitForPID(u32 pid)
{
HANDLE parent_handle = OpenProcess(SYNCHRONIZE, FALSE, static_cast<DWORD>(pid));
WaitForSingleObject(parent_handle, INFINITE);
CloseHandle(parent_handle);
if (parent_handle)
{
WaitForSingleObject(parent_handle, INFINITE);
CloseHandle(parent_handle);
}
}

void SetVisible(bool visible)
Expand Down

0 comments on commit a00dfee

Please sign in to comment.