1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 02:03:51 +08:00

Fix potential crash when exiting daily challenge screen

Without the schedule this will potentially run after disposal of the
local drawable hierarchy.

Closes https://github.com/ppy/osu/issues/28875.
This commit is contained in:
Dean Herbert 2024-07-16 03:02:04 +09:00
parent c854dfd6fb
commit 1083e71ce6
No known key found for this signature in database

View File

@ -122,7 +122,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{ {
var request = new IndexPlaylistScoresRequest(room.RoomID.Value!.Value, playlistItem.ID); var request = new IndexPlaylistScoresRequest(room.RoomID.Value!.Value, playlistItem.ID);
request.Success += req => request.Success += req => Schedule(() =>
{ {
var best = req.Scores.Select(s => s.CreateScoreInfo(scoreManager, rulesets, playlistItem, beatmap.Value.BeatmapInfo)).ToArray(); var best = req.Scores.Select(s => s.CreateScoreInfo(scoreManager, rulesets, playlistItem, beatmap.Value.BeatmapInfo)).ToArray();
var userBest = req.UserScore?.CreateScoreInfo(scoreManager, rulesets, playlistItem, beatmap.Value.BeatmapInfo); var userBest = req.UserScore?.CreateScoreInfo(scoreManager, rulesets, playlistItem, beatmap.Value.BeatmapInfo);
@ -165,7 +165,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
} }
userBestHeader.FadeTo(userBest == null ? 0 : 1); userBestHeader.FadeTo(userBest == null ? 0 : 1);
}; });
loadingLayer.Show(); loadingLayer.Show();
scoreFlow.FadeTo(0.5f, 400, Easing.OutQuint); scoreFlow.FadeTo(0.5f, 400, Easing.OutQuint);