dispose subscriptions when lockscreen changes
MODIFY
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModelBase.cs
WalletWasabi.Gui/Controls/LockScreen/LockScreenViewModelBase.cs
@@ -51,5 +51,29 @@ namespace WalletWasabi.Gui.Controls.LockScreen
{
}
+
+ #region IDisposable Support
+
+ private volatile bool _disposedValue = false; // To detect redundant calls
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposedValue)
+ {
+ if (disposing)
+ {
+ Disposables?.Dispose();
+ }
+
+ _disposedValue = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+ }
+
+ #endregion IDisposable Support
}
}

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -127,6 +127,8 @@ namespace WalletWasabi.Gui.ViewModels
private void CheckLockScreenType(string currentHash)
{
+ LockScreen?.Dispose();
+
if (currentHash.Length != 0)
{
LockScreen = new PinLockScreenViewModel();

dispose subscriptions when lockscreen changes