From aa01b725a65b509a9a00724fafd5eff4a3b74572 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 17 Oct 2015 20:03:07 -0400 Subject: [PATCH] Also handle lack of input callbacks when removing a lua function, not just on clear all --- BizHawk.Client.Common/lua/LuaFunctionList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/lua/LuaFunctionList.cs b/BizHawk.Client.Common/lua/LuaFunctionList.cs index 1298bd1fc8..6150c2abd6 100644 --- a/BizHawk.Client.Common/lua/LuaFunctionList.cs +++ b/BizHawk.Client.Common/lua/LuaFunctionList.cs @@ -18,12 +18,12 @@ namespace BizHawk.Client.Common public new bool Remove(NamedLuaFunction function) { - if (Global.Emulator.CanPollInput()) + if (Global.Emulator.InputCallbacksAvailable()) { Global.Emulator.AsInputPollable().InputCallbacks.Remove(function.Callback); } - if (Global.Emulator.CanDebug() && Global.Emulator.MemoryCallbacksAvailable()) + if (Global.Emulator.MemoryCallbacksAvailable()) { Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.Callback); }