8155001: SystemTray.remove() leaks GDI Objects in Windows

Reviewed-by: serb, alexp
This commit is contained in:
Dmitry Markov 2016-05-13 12:44:53 +03:00
parent e931bc512f
commit 7a40b8d5f7

View File

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