From: Vadim Zeitlin Date: Thu, 18 Oct 2001 23:29:09 +0000 (+0000) Subject: fixed resource leak in wxBitmap::CopyFromIconOrCursor X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/68f36a2ca14a0005874f3343391f85f4aa084f99 fixed resource leak in wxBitmap::CopyFromIconOrCursor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index df9dcd8c70..4f60c09474 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -144,6 +144,10 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon) refData->m_bitmapMask = new wxMask((WXHBITMAP) wxInvertMask(iconInfo.hbmMask, w, h)); + + // delete the old one now as we don't need it any more + ::DeleteObject(iconInfo.hbmMask); + #if WXWIN_COMPATIBILITY_2 refData->m_ok = TRUE; #endif // WXWIN_COMPATIBILITY_2