]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't leave the wxStaticBox hanging around after wxStaticLine
authorMattia Barbon <mbarbon@cpan.org>
Tue, 27 May 2003 20:28:51 +0000 (20:28 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Tue, 27 May 2003 20:28:51 +0000 (20:28 +0000)
destruction.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/statline.h
src/generic/statline.cpp

index 32ec10dee64b8d063baf3d1f7e2cadd9dc153b4b..5e5b13c24f91518388f5dca1ff55a6621ff0992e 100644 (file)
@@ -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,
index d1c9657c1a719af78d01dcf0dd297605fa9f3cc3..a7e4f99dc13d3ba81e6de43848bdbf5d3cacd8d8 100644 (file)
@@ -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
 {