From 0bb590c832fb50a6bcf40aecbae2cad918ebee94 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Thu, 22 Jul 1999 07:27:12 +0000 Subject: Pragma added around xlib.h to shut up the IRIX compiler warnings Fluid writes "class foo;" to the header and c file without prepending "extern" or "static". This patch also does this to "class foo bar;" which is wrong... Tabs draw very short labels. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Group.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/Fl_Group.cxx') diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index fc41157d7..80107fedf 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Group.cxx,v 1.8 1999/01/26 21:37:14 mike Exp $" +// "$Id: Fl_Group.cxx,v 1.8.2.1 1999/07/22 07:27:11 bill Exp $" // // Group widget for the Fast Light Tool Kit (FLTK). // @@ -255,18 +255,22 @@ Fl_Group::Fl_Group(int X,int Y,int W,int H,const char *l) } void Fl_Group::clear() { - Fl_Widget*const* a = array(); - for (int i=children(); i--;) { - Fl_Widget* o = *a++; - // test the parent to see if child already destructed: - if (o->parent() == this) delete o; - } - if (children() > 1) free((void*)array_); + Fl_Widget*const* old_array = array(); + int old_children = children(); + // clear everything now, in case fl_fix_focus recursively calls us: children_ = 0; array_ = 0; savedfocus_ = 0; resizable_ = this; init_sizes(); + // okay, now it is safe to destroy the children: + Fl_Widget*const* a = old_array; + for (int i=old_children; i--;) { + Fl_Widget* o = *a++; + // test the parent to see if child already destructed: + if (o->parent() == this) delete o; + } + if (old_children > 1) free((void*)old_array); } Fl_Group::~Fl_Group() {clear();} @@ -485,5 +489,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { } // -// End of "$Id: Fl_Group.cxx,v 1.8 1999/01/26 21:37:14 mike Exp $". +// End of "$Id: Fl_Group.cxx,v 1.8.2.1 1999/07/22 07:27:11 bill Exp $". // -- cgit v1.2.3