fix(client-ui): resolve Medium code-review finding (Client.UI-008)
Implement IDisposable on MainWindowViewModel to detach ConnectionStateChanged, call Teardown() on the subscription/alarm VMs, and dispose _service so the OPC UA session and SDK resources are released. Call Dispose() from MainWindow.OnClosing alongside the existing SaveSettings() call. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,10 @@ public partial class MainWindow : Window
|
||||
protected override void OnClosing(WindowClosingEventArgs e)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel vm)
|
||||
{
|
||||
vm.SaveSettings();
|
||||
vm.Dispose();
|
||||
}
|
||||
base.OnClosing(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user