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

View File

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