From f91e8382845cd084bb9b19923a71c736a63a8b6a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Jul 2003 20:36:31 +0000 Subject: [PATCH] set the containing sizer to NULL when destroying the sizer; this fixes a crash (don't ask me how could it work before) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/sizer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index c34e516932..3650a7b5b7 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -94,10 +94,16 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border, wxSizerItem::~wxSizerItem() { - if (m_userData) - delete m_userData; - if (m_sizer) + delete m_userData; + + if ( m_window ) + { + m_window->SetContainingSizer(NULL); + } + else // we must be a sizer + { delete m_sizer; + } } -- 2.45.2