Fix memory leak discovered by . Note to self: Don't get clever on RxUI expressions and be wary of switch pattern statements as well
MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
+using System;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using System.Windows.Input;
@@ -31,7 +32,8 @@ public class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
// Show the window if it was hidden.
ShowRequested?.Invoke(this, EventArgs.Empty);
- await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(new Dialogs.ShowErrorDialogViewModel(
+ await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(
+ new Dialogs.ShowErrorDialogViewModel(
"Wasabi is currently anonymising your wallet. Please try again in a few minutes.",
"Warning",
"Unable to close right now"));
@@ -45,15 +47,7 @@ public class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
AboutCommand = ReactiveCommand.Create(
() => dialogScreen.To(new AboutViewModel(navigateBack: dialogScreen.CurrentPage is not null)),
canExecute: dialogScreen.WhenAnyValue(x => x.CurrentPage)
- .SelectMany(x =>
- {
- return x switch
- {
- null => Observable.Return(true),
- AboutViewModel => Observable.Return(false),
- _ => x.WhenAnyValue(page => page.IsBusy).Select(isBusy => !isBusy)
- };
- }));
+ .Select(x => x is null));
using var bitmap = AssetHelpers.GetBitmapAsset("avares://WalletWasabi.Fluent/Assets/WasabiLogo.ico");
TrayIcon = new WindowIcon(bitmap);

Fix memory leak discovered by @SuperJMN . Note to self: Don't get clever on RxUI expressions and be wary of switch pattern statements as well