From 2c622593496b1d5aa8bfda98e18eb796a6212557 Mon Sep 17 00:00:00 2001 From: David Surovell Date: Tue, 22 Nov 2005 16:15:46 +0000 Subject: [PATCH] fixed memory leak git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 1da408f33b..8e32ae39ed 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -509,6 +509,12 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) void wxToolBar::CreateDisabledImageList() { + if (m_disabledImgList != NULL) + { + delete m_disabledImgList; + m_disabledImgList = NULL; + } + // as we can't use disabled image list with older versions of comctl32.dll, // don't even bother creating it if ( wxTheApp->GetComCtl32Version() >= 470 ) @@ -528,14 +534,12 @@ void wxToolBar::CreateDisabledImageList() bmpDisabled.GetMask() != NULL, GetToolsCount() ); - return; + break; } } // we don't have any disabled bitmaps } - - m_disabledImgList = NULL; } bool wxToolBar::Realize() @@ -631,8 +635,6 @@ bool wxToolBar::Realize() totalBitmapWidth, totalBitmapHeight); dcAllButtons.SelectObject(bitmap); - - } #endif // !__WXWINCE__ @@ -726,8 +728,6 @@ bool wxToolBar::Realize() // Map to system colours hBitmap = (HBITMAP)MapBitmap((WXHBITMAP) hBitmap, totalBitmapWidth, totalBitmapHeight); - - } bool addBitmap = true; -- 2.45.2