Also handle lack of input callbacks when removing a lua function, not just on clear all

This commit is contained in:
adelikat 2015-10-17 20:03:07 -04:00
parent ac43fe203b
commit aa01b725a6
1 changed files with 2 additions and 2 deletions

View File

@ -18,12 +18,12 @@ namespace BizHawk.Client.Common
public new bool Remove(NamedLuaFunction function) public new bool Remove(NamedLuaFunction function)
{ {
if (Global.Emulator.CanPollInput()) if (Global.Emulator.InputCallbacksAvailable())
{ {
Global.Emulator.AsInputPollable().InputCallbacks.Remove(function.Callback); 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); Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.Callback);
} }