From: Guilhem Lavaux Date: Sat, 18 Jul 1998 10:44:31 +0000 (+0000) Subject: wxFrame: OnSize() has a SEGV if wxFrame has no child. Fixed. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cf5f9c9c3e06f4d1104fdeabc61c5e756a24c872 wxFrame: OnSize() has a SEGV if wxFrame has no child. Fixed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 075ed1e7f6..c0631c4fce 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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()) diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 075ed1e7f6..c0631c4fce 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -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())