From efa52619af448cd1c30a2fc8b872030c6adcf25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 10 Jun 2021 16:12:20 +0200 Subject: [PATCH] user32: Delete info.hbmColor and hbmMask after copying. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Dösinger Signed-off-by: Alexandre Julliard --- 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; }