user32: Delete info.hbmColor and hbmMask after copying.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2021-06-10 16:12:20 +02:00 committed by Alexandre Julliard
parent 7ec5a7e1b6
commit efa52619af
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}