mirror of
https://github.com/ppy/osu
synced 2025-01-22 22:03:12 +00:00
Fix holding a selection while changing screens causing a crash
This commit is contained in:
parent
71eef238c4
commit
dad348111d
@ -481,8 +481,16 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
remove => throw new NotImplementedException();
|
remove => throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeginChange() => changeHandler?.BeginChange();
|
private IEditorChangeHandler? beginChangeHandler;
|
||||||
public void EndChange() => changeHandler?.EndChange();
|
|
||||||
|
public void BeginChange()
|
||||||
|
{
|
||||||
|
// Change handler may change between begin and end, which can cause unbalanced operations.
|
||||||
|
// Let's track the one that was used when beginning the change so we can call EndChange on it specifically.
|
||||||
|
(beginChangeHandler = changeHandler)?.BeginChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EndChange() => beginChangeHandler?.EndChange();
|
||||||
public void SaveState() => changeHandler?.SaveState();
|
public void SaveState() => changeHandler?.SaveState();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user