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