]> git.saurik.com Git - wxWidgets.git/commitdiff
wxFrame: OnSize() has a SEGV if wxFrame has no child. Fixed.
authorGuilhem Lavaux <lavaux@easynet.fr>
Sat, 18 Jul 1998 10:44:31 +0000 (10:44 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Sat, 18 Jul 1998 10:44:31 +0000 (10:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/frame.cpp
src/gtk1/frame.cpp

index 075ed1e7f6dc0cdc8203806668a78312ede08462..c0631c4fce53f4bf2130cd3979edf2bbb3984570 100644 (file)
@@ -258,6 +258,10 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
   if ( GetAutoLayout() )
     Layout();
   else {
+    // no child: go out !
+    if (!GetChildren()->First())
+      return;
+
     // do we have exactly one child?
     wxWindow *child = NULL;
     for(wxNode *node = GetChildren()->First(); node; node = node->Next())
index 075ed1e7f6dc0cdc8203806668a78312ede08462..c0631c4fce53f4bf2130cd3979edf2bbb3984570 100644 (file)
@@ -258,6 +258,10 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
   if ( GetAutoLayout() )
     Layout();
   else {
+    // no child: go out !
+    if (!GetChildren()->First())
+      return;
+
     // do we have exactly one child?
     wxWindow *child = NULL;
     for(wxNode *node = GetChildren()->First(); node; node = node->Next())