diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs index 545db1b271..f0af983992 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs @@ -64,6 +64,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES }); using (_exe.EnterExit()) { + // Marshal checks that function pointers passed to GetDelegateForFunctionPointer are + // _currently_ valid when created, even though they don't need to be valid until + // the delegate is later invoked. so GetInvoker needs to be acquired within a lock. _core = BizInvoker.GetInvoker(_exe, _exe); _comm = (CommStruct*)_core.DllInit().ToPointer(); }