Fix EndPlaying potentially doing cross-thread mutation

This commit is contained in:
smoogipoo 2021-05-21 15:57:39 +09:00
parent 2fdf8aa1aa
commit 7f712a4d04
1 changed files with 8 additions and 3 deletions

View File

@ -167,10 +167,15 @@ public void BeginPlaying(GameplayBeatmap beatmap, Score score)
public void EndPlaying()
{
IsPlaying = false;
currentBeatmap = null;
// This method is most commonly called via Dispose(), which is asynchronous.
// Todo: This should not be a thing, but requires framework changes.
Schedule(() =>
{
IsPlaying = false;
currentBeatmap = null;
EndPlayingInternal(currentState);
EndPlayingInternal(currentState);
});
}
public void WatchUser(int userId)