1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:03:13 +08:00

Fix screen exit potentially occuring during transition

This commit is contained in:
Dean Herbert 2020-10-28 18:47:15 +09:00
parent 4df8119852
commit 9807089834
2 changed files with 12 additions and 2 deletions

View File

@ -45,7 +45,12 @@ namespace osu.Game.Screens.Play
private void userBeganPlaying(int userId, SpectatorState state)
{
if (userId == score.ScoreInfo.UserID)
Schedule(this.Exit);
{
Schedule(() =>
{
if (this.IsCurrentScreen()) this.Exit();
});
}
}
protected override void Dispose(bool isDisposing)

View File

@ -28,7 +28,12 @@ namespace osu.Game.Screens.Play
private void userBeganPlaying(int userId, SpectatorState state)
{
if (userId == Score.UserID)
Schedule(this.Exit);
{
Schedule(() =>
{
if (this.IsCurrentScreen()) this.Exit();
});
}
}
protected override void Dispose(bool isDisposing)