Fix resource leak in wxMSW wxStaticBitmap when using RGBA icons.
Release the old handle if it wasn't freed by STM_SETIMAGE itself. Closes #16068. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c2ac6643cc
commit
8fa2694395
@ -294,10 +294,10 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
|
||||
m_isIcon ? IMAGE_ICON : IMAGE_BITMAP, (LPARAM)handle);
|
||||
// detect if this is still the handle we passed before or
|
||||
// if the static-control made a copy of the bitmap!
|
||||
if (m_currentHandle != 0 && oldHandle != (HGDIOBJ) m_currentHandle)
|
||||
if (oldHandle != 0 && oldHandle != (HGDIOBJ) m_currentHandle)
|
||||
{
|
||||
// the static control made a copy and we are responsible for deleting it
|
||||
DeleteObject((HGDIOBJ) oldHandle);
|
||||
::DeleteObject((HGDIOBJ) oldHandle);
|
||||
}
|
||||
|
||||
// Save bitmap handle only if it's not a temporary one, otherwise it's
|
||||
|
Loading…
Reference in New Issue
Block a user