src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp

Print this page

        

@@ -91,10 +91,12 @@
 AwtTrayIcon::~AwtTrayIcon() {
 }
 
 void AwtTrayIcon::Dispose() {
     SendTrayMessage(NIM_DELETE);
+    // Destroy the icon to avoid leak of GDI objects
+    ::DestroyIcon(m_nid.hIcon);
     UnlinkObjects();
 
     if (--sm_instCount == 0) {
         AwtTrayIcon::DestroyMessageWindow();
     }