From 7bbbc66715c5736e164dab53824496ca1188c600 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Mon, 23 Feb 2004 20:39:16 +0000 Subject: [PATCH] fixed icon handle leak in notification area svn path=/branches/lean-explorer/; revision=8338 --- reactos/subsys/system/explorer/taskbar/traynotify.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index 53c5691598e..4a6733f27c9 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -68,10 +68,14 @@ NotifyInfo& NotifyInfo::operator=(NOTIFYICONDATA* pnid) if (pnid->uFlags & NIF_MESSAGE) _uCallbackMessage = pnid->uCallbackMessage; - if (pnid->uFlags & NIF_ICON) - // Some applications destroy the icon immediatelly after completing the, - // NIM_ADD/MODIFY message, so we have to make a copy if it. + if (pnid->uFlags & NIF_ICON) { + // Some applications destroy the icon immediatelly after completing the + // NIM_ADD/MODIFY message, so we have to make a copy of it. + if (_hIcon) + DestroyIcon(_hIcon); + _hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, 16, 16, 0); + } #ifdef NIF_STATE // currently (as of 21.08.2003) missing in MinGW headers if (pnid->uFlags & NIF_STATE)