DIspose添加

This commit is contained in:
hsc
2026-06-11 15:45:29 +08:00
parent 9c661200b9
commit 5cac253cb8
8 changed files with 164 additions and 17 deletions

View File

@@ -84,7 +84,19 @@ namespace SettingModule.ViewModels
public void Dispose()
{
_scope?.Dispose();
try
{
if (DeviceList != null)
{
DeviceList = null!;
}
SelectedDevice = null;
_scopedContext = null!;
}
catch (Exception ex)
{
Logger.LoggerHelper.ErrorWithNotify($"释放配置管理组件SettingViewModel资源失败: {ex.Message}");
}
}
#region
@@ -191,5 +203,6 @@ namespace SettingModule.ViewModels
}
}
#endregion
}
}