- Fix bitmap leaks in STATIC_SetIcon and get_icon_size

svn path=/trunk/; revision=53191
This commit is contained in:
Cameron Gutman 2011-08-12 09:39:05 +00:00
parent 85e01470a4
commit 1b7607bcd9
2 changed files with 9 additions and 0 deletions

View file

@ -208,6 +208,9 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight, SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER ); SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
} }
DeleteObject(info.hbmMask);
if (info.hbmColor) DeleteObject(info.hbmColor);
} }
return prevIcon; return prevIcon;
} }

View file

@ -2201,6 +2201,12 @@ BOOL get_icon_size(HICON hIcon, SIZE *size)
{ {
size->cy /= 2; size->cy /= 2;
} }
else
{
DeleteObject(info.hbmColor);
}
DeleteObject(info.hbmMask);
return TRUE; return TRUE;
} }