mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Lock WorkingBeatmap cache to avoid threading issues (#5243)
Lock WorkingBeatmap cache to avoid threading issues
This commit is contained in:
commit
7ce2e1c5ee
@ -176,6 +176,8 @@ namespace osu.Game.Beatmaps
|
||||
if (beatmapInfo?.BeatmapSet == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
||||
return DefaultBeatmap;
|
||||
|
||||
lock (workingCache)
|
||||
{
|
||||
var cached = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
|
||||
|
||||
if (cached != null)
|
||||
@ -191,6 +193,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
return working;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform a lookup query on available <see cref="BeatmapSetInfo"/>s.
|
||||
|
Loading…
Reference in New Issue
Block a user