From 05d65177f8a80a872f987ba1f3b11f5da49c7768 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 18 Jul 2011 19:36:31 +0000 Subject: [PATCH] Fix memory leak in wxPanel::SetBackgroundBirmap() in wxMSW. The brush allocated for the bitmap was never freed, do free it in dtor. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/panel.h | 2 ++ src/msw/panel.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/wx/msw/panel.h b/include/wx/msw/panel.h index 5073fe30ba..4761192d66 100644 --- a/include/wx/msw/panel.h +++ b/include/wx/msw/panel.h @@ -34,6 +34,8 @@ public: Create(parent, winid, pos, size, style, name); } + virtual ~wxPanel(); + // This is overridden for MSW to return true for all panels that are child // of a window with themed background (such as wxNotebook) which should // show through the child panels. diff --git a/src/msw/panel.cpp b/src/msw/panel.cpp index e5b57eeb3a..c502caf9f5 100644 --- a/src/msw/panel.cpp +++ b/src/msw/panel.cpp @@ -33,6 +33,11 @@ // implementation // ============================================================================ +wxPanel::~wxPanel() +{ + delete m_backgroundBrush; +} + bool wxPanel::HasTransparentBackground() { for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) -- 2.45.2