aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-12-22 19:31:30 +0100
committerGitHub <noreply@github.com>2022-12-22 19:31:30 +0100
commit7cdf27e6dfcf61329317e641e6625599cda3f5b0 (patch)
treecc00a0269c196094d8be92aee819c3bfa5ad8b73
parent314166100f7f6434016ce38bd4e9add07b68c24b (diff)
downloadNorthstarLauncher-7cdf27e6dfcf61329317e641e6625599cda3f5b0.tar.gz
NorthstarLauncher-7cdf27e6dfcf61329317e641e6625599cda3f5b0.zip
Fix UI VM Destruction (again again) (#380)
-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);
}