File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments