Dispose collection caches on plugin disposal.

This commit is contained in:
Ottermandias 2024-07-28 12:57:59 +02:00
parent 19166d8cf4
commit d0c4d6984c

View file

@ -84,6 +84,12 @@ public class CollectionCacheManager : IDisposable, IService
_communicator.ModSettingChanged.Unsubscribe(OnModSettingChange);
_communicator.CollectionInheritanceChanged.Unsubscribe(OnCollectionInheritanceChange);
MetaFileManager.CharacterUtility.LoadingFinished -= IncrementCounters;
foreach (var collection in _storage)
{
collection._cache?.Dispose();
collection._cache = null;
}
}
public void AddChange(CollectionCache.ChangeData data)