Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
Fixes a handle leak in explorer.exe when an application repeatedly redraws the systray icon introduced by 5df5972f9aac.
GetIconInfoExW returns a copy, CopyImage does not take ownership, so we have to relese them. --- dlls/user32/cursoricon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index f820c10a0d8..7ad0a04a551 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1670,12 +1670,16 @@ HICON WINAPI CreateIcon( HINSTANCE instance, int width, int height, BYTE planes, HICON WINAPI CopyIcon( HICON icon ) { ICONINFOEXW info; + HICON res;
info.cbSize = sizeof(info); if (!GetIconInfoExW( icon, &info )) return NULL;
- return CopyImage( icon, info.fIcon ? IMAGE_ICON : IMAGE_CURSOR, 0, 0, 0 ); + res = CopyImage( icon, info.fIcon ? IMAGE_ICON : IMAGE_CURSOR, 0, 0, 0 ); + DeleteObject( info.hbmColor ); + DeleteObject( info.hbmMask ); + return res; }