Skip to content

Commit 8a96103

Browse files
committed
Dispose notify icon in App
1 parent 25c56f9 commit 8a96103

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ protected virtual void Dispose(bool disposing)
372372

373373
if (disposing)
374374
{
375+
// Dispose notify icon first to prevent it from showing balloon tip after main window is closed
376+
if (NotifyIcon != null)
377+
{
378+
NotifyIcon.Visible = false;
379+
NotifyIcon.Dispose();
380+
}
381+
375382
// Dispose needs to be called on the main Windows thread,
376383
// since some resources owned by the thread need to be disposed.
377384
_mainWindow?.Dispatcher.Invoke(_mainWindow.Dispose);

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ protected virtual void Dispose(bool disposing)
13131313
if (disposing)
13141314
{
13151315
_hwndSource?.Dispose();
1316-
App.NotifyIcon?.Dispose();
13171316
animationSoundWMP?.Close();
13181317
animationSoundWPF?.Dispose();
13191318
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;

0 commit comments

Comments
 (0)