From 8f663feda579d99eb2b2e531d757e443ba484a74 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sat, 23 Apr 2022 16:27:15 -0700 Subject: [PATCH] fix #3226 for real this time i hate threads... --- src/BizHawk.Client.Common/lua/LuaFile.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/BizHawk.Client.Common/lua/LuaFile.cs b/src/BizHawk.Client.Common/lua/LuaFile.cs index 4d8c3dba38..b64134a85b 100644 --- a/src/BizHawk.Client.Common/lua/LuaFile.cs +++ b/src/BizHawk.Client.Common/lua/LuaFile.cs @@ -53,6 +53,7 @@ return; } + Thread.Yield(0); // we MUST yield this thread, else old references to lua libs might be used (and those may contain references to a Dispose()'d emulator) State = RunState.Disabled; if (true /*NLua.Lua.WhichLua == "NLua"*/) Thread.GetTable("keepalives")[Thread] = null; Thread = null;