diff --git a/v3/pkg/application/systemtray_windows.go b/v3/pkg/application/systemtray_windows.go index 5e7703b54..827081ff9 100644 --- a/v3/pkg/application/systemtray_windows.go +++ b/v3/pkg/application/systemtray_windows.go @@ -247,4 +247,13 @@ func (s *windowsSystemTray) setIconPosition(position int) { } func (s *windowsSystemTray) destroy() { + // Remove and delete the system tray + getNativeApplication().unregisterSystemTray(s) + s.menu.Destroy() + w32.DestroyWindow(s.hwnd) + // Destroy the notification icon + nid := s.newNotifyIconData() + if !w32.ShellNotifyIcon(w32.NIM_DELETE, &nid) { + globalApplication.info(syscall.GetLastError().Error()) + } }