private void RemoveState(int frame) { int index = _states.IndexOfKey(frame); if (frame < 1 || index < 1) { return; } StateManagerState state = _states.ElementAt(index).Value; if (state.IsOnDisk) { state.Dispose(); } else { Used -= (ulong)state.Length; } _states.RemoveAt(index); }
public bool RemoveState(int frame) { int index = _states.IndexOfKey(frame); if (frame < 1 || index < 1) { return(false); } StateManagerState state = _states.Values[index]; if (state.IsOnDisk) { state.Dispose(); } else { Used -= (ulong)state.Length; } _states.RemoveAt(index); return(true); }