Fix race condition with NotifyIcon disposal (#412)

This commit is contained in:
pizzaboxer 2023-07-23 08:33:29 +01:00
parent cc39ee6e8a
commit 1779056655
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 2 additions and 2 deletions

View File

@ -317,7 +317,7 @@ namespace Bloxstrap
// this ordering is very important as all wpf windows are shown as modal dialogs, mess it up and you'll end up blocking input to one of them
dialog?.ShowBootstrapper();
if (Settings.Prop.EnableActivityTracking)
if (!IsNoLaunch && Settings.Prop.EnableActivityTracking)
NotifyIcon?.InitializeContextMenu();
bootstrapperTask.Wait();

View File

@ -134,7 +134,7 @@ namespace Bloxstrap.UI
App.Logger.WriteLine($"[NotifyIconWrapper::Dispose] Disposing NotifyIcon");
_menuContainer?.Dispatcher.Invoke(_menuContainer.Close);
_notifyIcon.Dispose();
_notifyIcon?.Dispose();
_disposed = true;