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);