1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 08:07:24 +08:00

Fix potential race condition with score retrieval

This commit is contained in:
Dean Herbert 2018-01-02 15:30:29 +09:00
parent 161e8d44b4
commit 4f8a830fbf

View File

@ -109,6 +109,13 @@ namespace osu.Game.Screens.Select.Leaderboards
{
if (value == placeholderState) return;
if (value != PlaceholderState.Successful)
{
getScoresRequest?.Cancel();
getScoresRequest = null;
Scores = null;
}
switch (placeholderState = value)
{
case PlaceholderState.NetworkFailure:
@ -211,10 +218,6 @@ namespace osu.Game.Screens.Select.Leaderboards
private void updateScores()
{
getScoresRequest?.Cancel();
getScoresRequest = null;
Scores = null;
if (Scope == LeaderboardScope.Local)
{
// TODO: get local scores from wherever here.