From: Vadim Zeitlin Date: Sun, 13 Jun 1999 22:10:16 +0000 (+0000) Subject: wxWindow::Fit() infinite loop bug fixed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bfac8499858dbb52ae4e712b718dcd08e777b4c2?ds=inline wxWindow::Fit() infinite loop bug fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 582ea1e9bb..87709ad66a 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -350,8 +350,9 @@ void wxWindowBase::Fit() int maxX = 0, maxY = 0; - wxWindowList::Node *node = GetChildren().GetFirst(); - while ( node ) + for ( wxWindowList::Node *node = GetChildren().GetFirst(); + node; + node = node->GetNext() ) { wxWindow *win = node->GetData(); if ( win->IsTopLevel() ) @@ -368,8 +369,6 @@ void wxWindowBase::Fit() maxX = wx + ww; if ( wy + wh > maxY ) maxY = wy + wh; - - node = node->GetNext(); } // leave a margin