1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 00:02:56 +08:00

Dispose token manually

Cover more branches with cancellation source disposal
This commit is contained in:
Dan Balasescu 2022-03-24 14:35:03 +09:00
parent 96a447f68b
commit d36944ac95

View File

@ -342,6 +342,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
} }
Schedule(() => Schedule(() =>
{
using (cancellationSource)
{ {
if (Room.Countdown != countdown) if (Room.Countdown != countdown)
return; return;
@ -349,13 +351,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
Room.Countdown = null; Room.Countdown = null;
MatchEvent(new CountdownChangedEvent { Countdown = null }); MatchEvent(new CountdownChangedEvent { Countdown = null });
using (cancellationSource)
{
if (stopSource.Token.IsCancellationRequested) if (stopSource.Token.IsCancellationRequested)
return; return;
}
StartMatch().WaitSafely(); StartMatch().WaitSafely();
}
}); });
} }