mGBA - fix NRE that can happen when rebooting core, fixes #1915
This commit is contained in:
parent
05b39a0ec8
commit
04cd7d867c
|
@ -65,13 +65,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||||
|
|
||||||
public void Remove(MemoryCallbackDelegate action)
|
public void Remove(MemoryCallbackDelegate action)
|
||||||
{
|
{
|
||||||
var cbToRemove = _callbacks.Single(container => container.Callback.Callback == action);
|
var cbToRemove = _callbacks.SingleOrDefault(container => container.Callback.Callback == action);
|
||||||
|
|
||||||
|
if (cbToRemove != null)
|
||||||
|
{
|
||||||
if (LibmGBA.BizClearWatchpoint(_mgba.Core, cbToRemove.ID))
|
if (LibmGBA.BizClearWatchpoint(_mgba.Core, cbToRemove.ID))
|
||||||
{
|
{
|
||||||
_callbacks.Remove(cbToRemove);
|
_callbacks.Remove(cbToRemove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void RemoveAll(IEnumerable<MemoryCallbackDelegate> actions)
|
public void RemoveAll(IEnumerable<MemoryCallbackDelegate> actions)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue