Skip to content

Commit

Permalink
Merge pull request ppy#7872 from EVAST9919/spotlights-fix
Browse files Browse the repository at this point in the history
Fix possible error in SpotlightsLayout after it's disposal
  • Loading branch information
peppy authored Feb 17, 2020
2 parents 582d968 + c78534d commit 0c1822b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Game/Overlays/Rankings/SpotlightsLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void LoadComplete()
private void getSpotlights()
{
spotlightsRequest = new GetSpotlightsRequest();
spotlightsRequest.Success += response => selector.Spotlights = response.Spotlights;
spotlightsRequest.Success += response => Schedule(() => selector.Spotlights = response.Spotlights);
api.Queue(spotlightsRequest);
}

Expand Down Expand Up @@ -151,11 +151,11 @@ private void onSuccess(GetSpotlightRankingsResponse response)

protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

spotlightsRequest?.Cancel();
getRankingsRequest?.Cancel();
cancellationToken?.Cancel();

base.Dispose(isDisposing);
}
}
}

0 comments on commit 0c1822b

Please sign in to comment.