mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 15:23:11 +08:00
Dispose token manually
Cover more branches with cancellation source disposal
This commit is contained in:
parent
96a447f68b
commit
d36944ac95
@ -343,19 +343,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
if (Room.Countdown != countdown)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Room.Countdown = null;
|
|
||||||
MatchEvent(new CountdownChangedEvent { Countdown = null });
|
|
||||||
|
|
||||||
using (cancellationSource)
|
using (cancellationSource)
|
||||||
{
|
{
|
||||||
|
if (Room.Countdown != countdown)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Room.Countdown = null;
|
||||||
|
MatchEvent(new CountdownChangedEvent { Countdown = null });
|
||||||
|
|
||||||
if (stopSource.Token.IsCancellationRequested)
|
if (stopSource.Token.IsCancellationRequested)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
StartMatch().WaitSafely();
|
StartMatch().WaitSafely();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user