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

Fix gameplay tests crashing when run multiple times

This commit is contained in:
Dan Balasescu 2022-08-09 14:41:36 +09:00
parent fbd645f06e
commit 6c671434ec

View File

@ -203,5 +203,15 @@ namespace osu.Game.Screens.Play
api.Queue(request);
return scoreSubmissionSource.Task;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
// Specific to tests, the player can be disposed without OnExiting() ever being called.
// We should make sure that the gameplay session has finished even in this case.
if (LoadedBeatmapSuccessfully)
spectatorClient.EndPlaying(GameplayState);
}
}
}