From a6e4b87f364cdb93ab9f8f31e886092f66d79434 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Sun, 11 Jun 2017 07:50:41 -0400 Subject: [PATCH] comments --- BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs | 3 +++ 1 file changed, 3 insertions(+) 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(); }