From a7018f0178006f0271077863149283c9f3d95d64 Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Thu, 22 Dec 2022 19:31:30 +0100 Subject: Fix UI VM Destruction (again again) (#380) --- NorthstarDLL/squirrel/squirrel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'NorthstarDLL/squirrel') diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp index eb4b6bed..5e968daa 100644 --- a/NorthstarDLL/squirrel/squirrel.cpp +++ b/NorthstarDLL/squirrel/squirrel.cpp @@ -317,11 +317,11 @@ template CSquirrelVM* __fastcall CreateNewVMHook(void* a return sqvm; } -template void (*__fastcall DestroyVM)(void* a1, HSquirrelVM* sqvm); -template void __fastcall DestroyVMHook(void* a1, HSquirrelVM* sqvm) +template void (*__fastcall DestroyVM)(void* a1, CSquirrelVM* sqvm); +template void __fastcall DestroyVMHook(void* a1, CSquirrelVM* sqvm) { ScriptContext realContext = context; // ui and client use the same function so we use this for prints - if (IsUIVM(context, sqvm)) + if (IsUIVM(context, sqvm->sqvm)) { realContext = ScriptContext::UI; g_pSquirrel->VMDestroyed(); @@ -329,7 +329,7 @@ template void __fastcall DestroyVMHook(void* a1, HSquirr } else { - g_pSquirrel->m_pSQVM = nullptr; // Fixes a race-like bug + g_pSquirrel->VMDestroyed(); DestroyVM(a1, sqvm); } -- cgit v1.2.3