Skip to content

Commit

Permalink
Fix race condition with NotifyIcon disposal (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jul 23, 2023
1 parent cc39ee6 commit 1779056
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ protected override void OnStartup(StartupEventArgs e)
// 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();
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/NotifyIconWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void Dispose()
App.Logger.WriteLine($"[NotifyIconWrapper::Dispose] Disposing NotifyIcon");

_menuContainer?.Dispatcher.Invoke(_menuContainer.Close);
_notifyIcon.Dispose();
_notifyIcon?.Dispose();

_disposed = true;

Expand Down

0 comments on commit 1779056

Please sign in to comment.