Skip to content

Commit c4402e9

Browse files
authored
Fix potential crash due to handling scores in leaderboard post-disposal (#36860)
Closes #36858. Classic.
1 parent de9cf75 commit c4402e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

osu.Game/Screens/Select/BeatmapLeaderboardWedge.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ public void RefetchScores()
256256
{
257257
// only bind this after the first fetch to avoid reading stale scores.
258258
fetchedScores.BindTo(leaderboardManager.Scores);
259-
fetchedScores.BindValueChanged(_ => updateScores(), true);
259+
260+
// Schedule is important here to avoid handling changes after this drawable is disposed.
261+
fetchedScores.BindValueChanged(_ => Schedule(updateScores), true);
260262
initialFetchComplete = true;
261263
}
262264
}, initialFetchComplete && fetchScope != BeatmapLeaderboardScope.Local ? 300 : 0);

0 commit comments

Comments
 (0)