mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Merge pull request #9089 from frenzibyte/fix-beatmap-lookup-cache-not-disposed
Fix beatmap-online-lookup-queue potentially throwing on OsuGameTestScene
This commit is contained in:
commit
e763473e23
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// Handles the storage and retrieval of Beatmaps/WorkingBeatmaps.
|
||||
/// </summary>
|
||||
public partial class BeatmapManager : DownloadableArchiveModelManager<BeatmapSetInfo, BeatmapSetFileInfo>
|
||||
public partial class BeatmapManager : DownloadableArchiveModelManager<BeatmapSetInfo, BeatmapSetFileInfo>, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when a single difficulty has been hidden.
|
||||
@ -433,6 +433,11 @@ namespace osu.Game.Beatmaps
|
||||
return endTime - startTime;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
onlineLookupQueue?.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A dummy WorkingBeatmap for the purpose of retrieving a beatmap for star difficulty calculation.
|
||||
/// </summary>
|
||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
public partial class BeatmapManager
|
||||
{
|
||||
private class BeatmapOnlineLookupQueue
|
||||
private class BeatmapOnlineLookupQueue : IDisposable
|
||||
{
|
||||
private readonly IAPIProvider api;
|
||||
private readonly Storage storage;
|
||||
@ -180,6 +180,11 @@ namespace osu.Game.Beatmaps
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
cacheDownloadRequest?.Dispose();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
private class CachedOnlineBeatmapLookup
|
||||
|
@ -337,6 +337,7 @@ namespace osu.Game
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
RulesetStore?.Dispose();
|
||||
BeatmapManager?.Dispose();
|
||||
|
||||
contextFactory.FlushConnections();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user