Typos fixed.

Corrected children's deletion (strict now).
  Corrected scrolled window's setup upon startup
    (with/without scrollbars etc.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-05-11 18:28:37 +00:00
parent 1a5594b80f
commit eb082a088a
11 changed files with 39 additions and 50 deletions

View File

@@ -178,8 +178,8 @@ wxWindowBase::~wxWindowBase()
// Just in case we've loaded a top-level window via LoadNativeDialog but
// we weren't a dialog class
wxTopLevelWindows.DeleteObject(this);
DestroyChildren();
wxASSERT_MSG( GetChildren().GetCount() == 0, "children not destroyed" );
if ( m_windowValidator )
delete m_windowValidator;
@@ -244,13 +244,15 @@ bool wxWindowBase::Close(bool force)
bool wxWindowBase::DestroyChildren()
{
wxWindowList::Node *node;
for ( node = GetChildren().GetFirst(); node; node = node->GetNext() )
while ( (node = GetChildren().GetFirst()) )
{
wxWindow *child = node->GetData();
if ( child )
{
delete child;
}
wxASSERT_MSG( child, "m_children contains empty nodes" );
delete child;
wxASSERT_MSG( !GetChildren().Find(child), "child didn't remove itself using RemoveChild()" );
}
return TRUE;