From 9757709242423125e22353888d3d961da1a0b2ca Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 27 Jan 2015 21:48:18 +0000 Subject: [PATCH] Lua - check if memory callbacks are implemented before attempting to remove memory callbacks --- BizHawk.Client.Common/lua/LuaFunctionList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/lua/LuaFunctionList.cs b/BizHawk.Client.Common/lua/LuaFunctionList.cs index 359c044985..f49d425145 100644 --- a/BizHawk.Client.Common/lua/LuaFunctionList.cs +++ b/BizHawk.Client.Common/lua/LuaFunctionList.cs @@ -23,7 +23,7 @@ namespace BizHawk.Client.Common Global.Emulator.AsInputPollable().InputCallbacks.Remove(function.Callback); } - if (Global.Emulator.CanDebug()) + if (Global.Emulator.CanDebug() && Global.Emulator.MemoryCallbacksAvailable()) { Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.Callback); }