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;
+ }
}
if (item->GetSizer() == sizer)
{
item->DetachSizer();
+ delete item;
m_children.Erase( node );
return true;
}
if (item->GetWindow() == window)
{
item->GetWindow()->SetContainingSizer( NULL );
+ delete item;
m_children.Erase( node );
return true;
}
else if( item->IsWindow() )
item->GetWindow()->SetContainingSizer( NULL );
+ delete item;
m_children.Erase( node );
return true;
}