From d36944ac950d86761931befc4a7e020040d9ce1e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 24 Mar 2022 14:35:03 +0900 Subject: [PATCH] Dispose token manually Cover more branches with cancellation source disposal --- .../Visual/Multiplayer/TestMultiplayerClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs b/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs index 1f20292437..5fa2ca8890 100644 --- a/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs +++ b/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs @@ -343,19 +343,19 @@ namespace osu.Game.Tests.Visual.Multiplayer Schedule(() => { - if (Room.Countdown != countdown) - return; - - Room.Countdown = null; - MatchEvent(new CountdownChangedEvent { Countdown = null }); - using (cancellationSource) { + if (Room.Countdown != countdown) + return; + + Room.Countdown = null; + MatchEvent(new CountdownChangedEvent { Countdown = null }); + if (stopSource.Token.IsCancellationRequested) return; - } - StartMatch().WaitSafely(); + StartMatch().WaitSafely(); + } }); }