Merge branch 'thread-safe-spectator-client' into fix-spectator-playing-state-5

This commit is contained in:
smoogipoo
2021-05-20 19:46:26 +09:00
2 changed files with 10 additions and 6 deletions

View File

@ -182,10 +182,14 @@ namespace osu.Game.Online.Spectator
public void StopWatchingUser(int userId)
{
watchingUsers.Remove(userId);
playingUserStates.Remove(userId);
StopWatchingUserInternal(userId);
// This method is most commonly called via Dispose(), which is asynchronous.
// Todo: This should not be a thing, but requires framework changes.
Schedule(() =>
{
watchingUsers.Remove(userId);
playingUserStates.Remove(userId);
StopWatchingUserInternal(userId);
});
}
protected abstract Task BeginPlayingInternal(SpectatorState state);