diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index c9ab34629b930fa1551bea74a54433e22ff44999..e8fc7abb799b7d38c2cbe78501aa9e9119bab0d2 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -207,6 +207,8 @@ BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem) static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem) { + if(ptrayItem->notifyIcon.hIcon) + DestroyIcon(ptrayItem->notifyIcon.hIcon); if(ptrayItem->hWndToolTip) DestroyWindow(ptrayItem->hWndToolTip); if(ptrayItem->hWnd) @@ -223,7 +225,7 @@ void SYSTRAY_ItemSetMessage(SystrayItem *ptrayItem, UINT uCallbackMessage) void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon) { - ptrayItem->notifyIcon.hIcon = hIcon; /* do we need a copy? */ + ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon); InvalidateRect(ptrayItem->hWnd, NULL, TRUE); }