Do not attempt to remove what isn't there. (fixes: removing a marker before a state was reserved would throw an exception.)

This commit is contained in:
SuuperW 2021-01-15 09:38:08 -06:00
parent 6424e35c6a
commit b6d77586af
1 changed files with 5 additions and 2 deletions

View File

@ -268,8 +268,11 @@ namespace BizHawk.Client.Common
throw new InvalidOperationException("Frame 0 can not be evicted.");
}
_reserved.Remove(frame);
StateCache.Remove(frame);
if (_reserved.ContainsKey(frame))
{
_reserved.Remove(frame);
StateCache.Remove(frame);
}
}
public void Capture(int frame, IStatable source, bool force = false)