From d7c40406e6353e73f79b4842f0b1130ec5b97437 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Tue, 27 May 2003 20:28:51 +0000 Subject: [PATCH] Don't leave the wxStaticBox hanging around after wxStaticLine destruction. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/statline.h | 4 +++- src/generic/statline.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/statline.h b/include/wx/generic/statline.h index 32ec10dee6..5e5b13c24f 100644 --- a/include/wx/generic/statline.h +++ b/include/wx/generic/statline.h @@ -27,7 +27,7 @@ class WXDLLEXPORT wxStaticLine : public wxStaticLineBase public: // constructors and pseudo-constructors - wxStaticLine() { } + wxStaticLine() { m_statbox = NULL; } wxStaticLine( wxWindow *parent, wxWindowID id, @@ -39,6 +39,8 @@ public: Create(parent, id, pos, size, style, name); } + virtual ~wxStaticLine(); + bool Create( wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, diff --git a/src/generic/statline.cpp b/src/generic/statline.cpp index d1c9657c1a..a7e4f99dc1 100644 --- a/src/generic/statline.cpp +++ b/src/generic/statline.cpp @@ -48,6 +48,8 @@ bool wxStaticLine::Create( wxWindow *parent, long style, const wxString &name) { + m_statbox = NULL; + if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; @@ -61,6 +63,10 @@ bool wxStaticLine::Create( wxWindow *parent, return TRUE; } +wxStaticLine::~wxStaticLine() +{ + delete m_statbox; +} WXWidget wxStaticLine::GetMainWidget() const { -- 2.45.2