From 99c3826b98390daf2a0fbd2bbcf5f77ab7f302f4 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 14 Jul 2018 05:48:40 +0500 Subject: [PATCH] Fixed bug with unsaved ui style --- src/xrGame/GamePersistent.cpp | 1 - src/xrGame/xrGame.cpp | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xrGame/GamePersistent.cpp b/src/xrGame/GamePersistent.cpp index ba63566615b..c0059cb0e6e 100644 --- a/src/xrGame/GamePersistent.cpp +++ b/src/xrGame/GamePersistent.cpp @@ -224,7 +224,6 @@ void CGamePersistent::OnAppEnd() clean_game_globals(); GMLib.Unload(); - CleanupUIStyleToken(); } void CGamePersistent::Start(LPCSTR op) { inherited::Start(op); } diff --git a/src/xrGame/xrGame.cpp b/src/xrGame/xrGame.cpp index 408ed56a658..999ab133cb9 100644 --- a/src/xrGame/xrGame.cpp +++ b/src/xrGame/xrGame.cpp @@ -13,6 +13,7 @@ #include "xrEngine/profiler.h" extern void FillUIStyleToken(); +extern void CleanupUIStyleToken(); extern "C" { DLL_API IFactoryObject* __cdecl xrFactory_Create(CLASS_ID clsid) @@ -51,7 +52,10 @@ BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved) break; } - case DLL_PROCESS_DETACH: { break; + case DLL_PROCESS_DETACH: + { + CleanupUIStyleToken(); + break; } } return (TRUE);