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
This commit is contained in:
Mattia Barbon
2003-05-27 20:28:51 +00:00
parent e6275f8d02
commit d7c40406e6
2 changed files with 9 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
public: public:
// constructors and pseudo-constructors // constructors and pseudo-constructors
wxStaticLine() { } wxStaticLine() { m_statbox = NULL; }
wxStaticLine( wxWindow *parent, wxStaticLine( wxWindow *parent,
wxWindowID id, wxWindowID id,
@@ -39,6 +39,8 @@ public:
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
virtual ~wxStaticLine();
bool Create( wxWindow *parent, bool Create( wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint &pos = wxDefaultPosition, const wxPoint &pos = wxDefaultPosition,

View File

@@ -48,6 +48,8 @@ bool wxStaticLine::Create( wxWindow *parent,
long style, long style,
const wxString &name) const wxString &name)
{ {
m_statbox = NULL;
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE; return FALSE;
@@ -61,6 +63,10 @@ bool wxStaticLine::Create( wxWindow *parent,
return TRUE; return TRUE;
} }
wxStaticLine::~wxStaticLine()
{
delete m_statbox;
}
WXWidget wxStaticLine::GetMainWidget() const WXWidget wxStaticLine::GetMainWidget() const
{ {