summaryrefslogtreecommitdiff
path: root/Source/Core/WinUpdater/WinUI.cpp
diff options
context:
space:
mode:
authorSilent <zdanio95@gmail.com>2019-06-24 20:55:52 +0200
committerSilent <zdanio95@gmail.com>2019-07-22 19:29:22 +0200
commita00dfeecf0a7742366a32081d837fec1ebcead14 (patch)
tree9fba0e94dd6d7efbe04a6eb79bb8d10534b5d474 /Source/Core/WinUpdater/WinUI.cpp
parentd355abaf0cb064963b9c6a4b99d5c70fe61ebf5a (diff)
WinUpdater: Properly account for failure in WaitForPID
Diffstat (limited to 'Source/Core/WinUpdater/WinUI.cpp')
-rw-r--r--Source/Core/WinUpdater/WinUI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/WinUpdater/WinUI.cpp b/Source/Core/WinUpdater/WinUI.cpp
index d65b00033d..97f2da459b 100644
--- a/Source/Core/WinUpdater/WinUI.cpp
+++ b/Source/Core/WinUpdater/WinUI.cpp
@@ -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)