diff --git a/osu.Game/Online/Spectator/SpectatorStreamingClient.cs b/osu.Game/Online/Spectator/SpectatorStreamingClient.cs index 13b12d9add..378096c7fb 100644 --- a/osu.Game/Online/Spectator/SpectatorStreamingClient.cs +++ b/osu.Game/Online/Spectator/SpectatorStreamingClient.cs @@ -303,13 +303,14 @@ namespace osu.Game.Online.Spectator /// Whether the action provided in should be run once immediately for all users currently playing. public void BindUserBeganPlaying(Action callback, bool runOnceImmediately = false) { - OnUserBeganPlaying += callback; - - if (!runOnceImmediately) - return; - + // The lock is taken before the event is subscribed to to prevent doubling of events. lock (userLock) { + OnUserBeganPlaying += callback; + + if (!runOnceImmediately) + return; + foreach (var (userId, state) in playingUserStates) callback(userId, state); }