mirror of
https://github.com/ppy/osu
synced 2024-12-17 20:35:21 +00:00
Fix potential race condition in song bar beatmap lookup flow
Cancelling a web request may not necessarily cancel the callbacks. This might help with https://github.com/ppy/osu/issues/24598.
This commit is contained in:
parent
34b279845b
commit
cf9c8120c5
@ -92,8 +92,16 @@ namespace osu.Game.Tournament.IPC
|
||||
else
|
||||
{
|
||||
beatmapLookupRequest = new GetBeatmapRequest(new APIBeatmap { OnlineID = beatmapId });
|
||||
beatmapLookupRequest.Success += b => Beatmap.Value = new TournamentBeatmap(b);
|
||||
beatmapLookupRequest.Failure += _ => Beatmap.Value = null;
|
||||
beatmapLookupRequest.Success += b =>
|
||||
{
|
||||
if (lastBeatmapId == beatmapId)
|
||||
Beatmap.Value = new TournamentBeatmap(b);
|
||||
};
|
||||
beatmapLookupRequest.Failure += _ =>
|
||||
{
|
||||
if (lastBeatmapId == beatmapId)
|
||||
Beatmap.Value = null;
|
||||
};
|
||||
API.Queue(beatmapLookupRequest);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user