mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Fix race due to StopWatchingUser() being called asynchronously
This commit is contained in:
parent
5a8b8782d3
commit
06c99e8c7c
@ -182,9 +182,13 @@ namespace osu.Game.Online.Spectator
|
||||
|
||||
public void StopWatchingUser(int userId)
|
||||
{
|
||||
watchingUsers.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);
|
||||
StopWatchingUserInternal(userId);
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract Task BeginPlayingInternal(SpectatorState state);
|
||||
|
Loading…
Reference in New Issue
Block a user