diff --git a/GFramework.Game/setting/SettingsModel.cs b/GFramework.Game/setting/SettingsModel.cs index 17fb299..055c2c2 100644 --- a/GFramework.Game/setting/SettingsModel.cs +++ b/GFramework.Game/setting/SettingsModel.cs @@ -12,7 +12,7 @@ namespace GFramework.Game.setting; /// /// 设置模型类,用于管理不同类型的应用程序设置部分 /// -public class SettingsModel : AbstractModel, ISettingsModel, IDisposable +public class SettingsModel : AbstractModel, ISettingsModel { private static readonly ILogger Log = LoggerFactoryResolver.Provider.CreateLogger(nameof(SettingsModel)); private readonly ConcurrentDictionary _applicators = new(); @@ -20,16 +20,8 @@ public class SettingsModel : AbstractModel, ISettingsModel, IDisposable private readonly ConcurrentDictionary _loadAsyncMethodCache = new(); private readonly ConcurrentDictionary> _migrationCache = new(); private readonly ConcurrentDictionary<(Type type, int from), ISettingsMigration> _migrations = new(); - private bool _disposed; private ISettingsPersistence? _persistence; - public void Dispose() - { - Dispose(disposing: true); - GC.SuppressFinalize(this); - } - - // ----------------------------- // Data // ----------------------------- @@ -207,22 +199,4 @@ public class SettingsModel : AbstractModel, ISettingsModel, IDisposable { _persistence = this.GetUtility(); } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) return; - if (disposing) - { - // 清理托管资源 - _dataSettings.Clear(); - _applicators.Clear(); - _migrations.Clear(); - _migrationCache.Clear(); - _loadAsyncMethodCache.Clear(); - } - - // 清理非托管资源(如果有) - - _disposed = true; - } } \ No newline at end of file