From 2a0570df9492a20aa4236745a844f6e939731e47 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 7 Apr 2020 18:18:45 +0100 Subject: [PATCH] Make bugfix consistent with official code --- src/Main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 6d9f1905..a8806bc8 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -279,12 +279,18 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (conf.display_mode == 1) { if (!StartDirectDraw(hWnd, 0, 0)) + { + ReleaseMutex(hMutex); return 0; + } } else { if (!StartDirectDraw(hWnd, 1, 0)) + { + ReleaseMutex(hMutex); return 0; + } } #else // Doesn't handle StartDirectDraw failing @@ -338,7 +344,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine #ifdef FIX_BUGS if (!StartDirectDraw(hWnd, 2, depth)) + { + ReleaseMutex(hMutex); return 0; + } #else // Doesn't handle StartDirectDraw failing StartDirectDraw(hWnd, 2, depth);