aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-12-22 19:31:30 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-01-04 14:55:25 +0100
commita7018f0178006f0271077863149283c9f3d95d64 (patch)
treea967a60a7d2517228e492a095ac521815a775e36 /NorthstarDLL
parenta4a5338a9d392761b51d746f231116e2327cc995 (diff)
downloadNorthstarLauncher-a7018f0178006f0271077863149283c9f3d95d64.tar.gz
NorthstarLauncher-a7018f0178006f0271077863149283c9f3d95d64.zip
Fix UI VM Destruction (again again) (#380)
Diffstat (limited to 'NorthstarDLL')
-rw-r--r--NorthstarDLL/squirrel/squirrel.cpp8
1 files changed, 4 insertions, 4 deletions
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 <ScriptContext context> CSquirrelVM* __fastcall CreateNewVMHook(void* a
return sqvm;
}
-template <ScriptContext context> void (*__fastcall DestroyVM)(void* a1, HSquirrelVM* sqvm);
-template <ScriptContext context> void __fastcall DestroyVMHook(void* a1, HSquirrelVM* sqvm)
+template <ScriptContext context> void (*__fastcall DestroyVM)(void* a1, CSquirrelVM* sqvm);
+template <ScriptContext context> 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<ScriptContext::UI>->VMDestroyed();
@@ -329,7 +329,7 @@ template <ScriptContext context> void __fastcall DestroyVMHook(void* a1, HSquirr
}
else
{
- g_pSquirrel<context>->m_pSQVM = nullptr; // Fixes a race-like bug
+ g_pSquirrel<context>->VMDestroyed();
DestroyVM<context>(a1, sqvm);
}