From 4f826589e51fc504db7f0ece73fa94e2e9da374c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Dec 2021 12:20:07 +0900 Subject: [PATCH] Remove subscription logic for the time being --- .../LegacyDatabasedSkinResourceStore.cs | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/osu.Game/Skinning/LegacyDatabasedSkinResourceStore.cs b/osu.Game/Skinning/LegacyDatabasedSkinResourceStore.cs index 667dc1876b..cd90fea9bb 100644 --- a/osu.Game/Skinning/LegacyDatabasedSkinResourceStore.cs +++ b/osu.Game/Skinning/LegacyDatabasedSkinResourceStore.cs @@ -1,14 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; -using System.Diagnostics; -using osu.Framework.Development; using osu.Framework.Extensions; using osu.Framework.IO.Stores; using osu.Game.Extensions; -using Realms; namespace osu.Game.Skinning { @@ -16,38 +12,12 @@ namespace osu.Game.Skinning { private readonly Dictionary fileToStoragePathMapping = new Dictionary(); - private readonly IDisposable subscription; - public LegacyDatabasedSkinResourceStore(SkinInfo source, IResourceStore underlyingStore) : base(underlyingStore) { - // Subscribing to non-managed instances doesn't work. - // In this usage, the skin may be non-managed in tests. - if (source.IsManaged) - { - // Subscriptions can only work on the main thread. - Debug.Assert(ThreadSafety.IsUpdateThread); - - subscription = source.Files - .AsRealmCollection().SubscribeForNotifications((sender, changes, error) => - { - if (changes == null) - return; - - // If a large number of changes are made on skin files, this may be better suited to being cleared here - // and reinitialised on next usage. - initialiseFileCache(source); - }); - } - initialiseFileCache(source); } - ~LegacyDatabasedSkinResourceStore() - { - Dispose(false); - } - private void initialiseFileCache(SkinInfo source) { fileToStoragePathMapping.Clear(); @@ -65,13 +35,6 @@ namespace osu.Game.Skinning } } - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - subscription?.Dispose(); - } - private string getPathForFile(string filename) => fileToStoragePathMapping.TryGetValue(filename.ToLower(), out string path) ? path : null;