Skip to content

Commit

Permalink
fix(client/launcher): UI-exit event should be manual-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
blattersturm committed Jul 8, 2021
1 parent 931a56e commit f03d22a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions code/client/launcher/Main.cpp
Expand Up @@ -686,8 +686,8 @@ int RealMain()

auto minModeManifest = InitMinMode();

g_uiExitEvent = CreateEvent(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIExit%s", IsCL2() ? L"CL2" : L""));
g_uiDoneEvent = CreateEvent(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIDone%s", IsCL2() ? L"CL2" : L""));
g_uiExitEvent = CreateEventW(NULL, TRUE, FALSE, va(L"CitizenFX_PreUIExit%s", IsCL2() ? L"CL2" : L""));
g_uiDoneEvent = CreateEventW(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIDone%s", IsCL2() ? L"CL2" : L""));

if (initState->IsMasterProcess() && !toolMode && !launch::IsSDK())
{
Expand Down Expand Up @@ -817,6 +817,7 @@ int RealMain()

SetEvent(g_uiDoneEvent);

#if !defined(_DEBUG)
if (!initState->isReverseGame)
{
// run UI polling loop if need be, anyway
Expand All @@ -835,6 +836,7 @@ int RealMain()
}
}
}
#endif

UI_DestroyTen();
}).detach();
Expand Down
4 changes: 2 additions & 2 deletions code/components/rage-graphics-five/src/RenderHooks.cpp
Expand Up @@ -517,8 +517,8 @@ void DLL_EXPORT UiDone()
static HostSharedData<CfxState> initState("CfxInitState");
WaitForSingleObject(g_gameWindowEvent, INFINITE);

auto uiExitEvent = CreateEvent(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIExit%s", IsCL2() ? L"CL2" : L""));
auto uiDoneEvent = CreateEvent(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIDone%s", IsCL2() ? L"CL2" : L""));
auto uiExitEvent = CreateEventW(NULL, TRUE, FALSE, va(L"CitizenFX_PreUIExit%s", IsCL2() ? L"CL2" : L""));
auto uiDoneEvent = CreateEventW(NULL, FALSE, FALSE, va(L"CitizenFX_PreUIDone%s", IsCL2() ? L"CL2" : L""));

if (uiExitEvent)
{
Expand Down

0 comments on commit f03d22a

Please sign in to comment.