Fix eviction logic for _gapFiller. (we were attempting to remove the wrong value from StateCache, and also weren't checking for reserved)

This commit is contained in:
SuuperW 2020-12-20 18:06:50 -06:00
parent 01bcf22802
commit b5b1e17851
1 changed files with 11 additions and 1 deletions

View File

@ -389,7 +389,17 @@ namespace BizHawk.Client.Common
AddStateCache(frame);
source.SaveStateBinary(new BinaryWriter(s));
},
index => StateCache.Remove(index));
index =>
{
var state = _gapFiller.GetState(index);
StateCache.Remove(state.Frame);
if (_reserveCallback(state.Frame))
{
AddToReserved(state);
return;
}
});
}
public void Clear()