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
This commit is contained in:
Vadim Zeitlin
2003-07-12 20:36:31 +00:00
parent fd82f4e6e9
commit f91e838284

View File

@@ -94,10 +94,16 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border,
wxSizerItem::~wxSizerItem() wxSizerItem::~wxSizerItem()
{ {
if (m_userData) delete m_userData;
delete m_userData;
if (m_sizer) if ( m_window )
{
m_window->SetContainingSizer(NULL);
}
else // we must be a sizer
{
delete m_sizer; delete m_sizer;
}
} }