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

Fix intermittent leaderboard crash due to request finishing after drawable is disposed

This commit is contained in:
Dean Herbert 2022-09-23 20:18:44 +09:00
parent 2a5556de33
commit 0fa5e1b28e

View File

@ -153,10 +153,11 @@ namespace osu.Game.Screens.Select.Leaderboards
var req = new GetScoresRequest(fetchBeatmapInfo, fetchRuleset, Scope, requestMods);
req.Success += r => SetScores(
// Schedule is required to avoid potential object disposed exception when LoadComponentAsync is eventually called.
req.Success += r => Schedule(() => SetScores(
scoreManager.OrderByTotalScore(r.Scores.Select(s => s.ToScoreInfo(rulesets, fetchBeatmapInfo))),
r.UserScore?.CreateScoreInfo(rulesets, fetchBeatmapInfo)
);
));
return req;
}