1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 07:27:45 +08:00

Merge pull request #7872 from EVAST9919/spotlights-fix

Fix possible error in SpotlightsLayout after it's disposal
This commit is contained in:
Dean Herbert 2020-02-17 17:54:42 +09:00 committed by GitHub
commit 0c1822bafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Rankings
private void getSpotlights()
{
spotlightsRequest = new GetSpotlightsRequest();
spotlightsRequest.Success += response => selector.Spotlights = response.Spotlights;
spotlightsRequest.Success += response => Schedule(() => selector.Spotlights = response.Spotlights);
api.Queue(spotlightsRequest);
}
@ -151,11 +151,11 @@ namespace osu.Game.Overlays.Rankings
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
spotlightsRequest?.Cancel();
getRankingsRequest?.Cancel();
cancellationToken?.Cancel();
base.Dispose(isDisposing);
}
}
}