diff options
Diffstat (limited to 'src/Fl_Group.cxx')
| -rw-r--r-- | src/Fl_Group.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index f895c442a..1ccaaca94 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Group.cxx,v 1.8.2.8.2.7 2001/12/19 18:40:13 easysw Exp $" +// "$Id: Fl_Group.cxx,v 1.8.2.8.2.8 2001/12/20 14:41:44 easysw Exp $" // // Group widget for the Fast Light Tool Kit (FLTK). // @@ -298,7 +298,7 @@ void Fl_Group::clear() { int old_children = children(); // clear everything now, in case fl_fix_focus recursively calls us: children_ = 0; - // array_ = 0; dont do this, it will clobber old_array if only one child + //array_ = 0; //dont do this, it will clobber old_array if only one child savedfocus_ = 0; resizable_ = this; init_sizes(); @@ -306,7 +306,7 @@ void Fl_Group::clear() { Fl_Widget*const* a = old_array; for (int i=old_children; i--;) { Fl_Widget* o = *a++; - delete o; + if (o->parent() == this) delete o; } if (old_children > 1) free((void*)old_array); } @@ -347,6 +347,7 @@ void Fl_Group::insert(Fl_Widget &o, int index) { void Fl_Group::add(Fl_Widget &o) {insert(o, children_);} void Fl_Group::remove(Fl_Widget &o) { + if (!children_) return; int i = find(o); if (i >= children_) return; if (&o == savedfocus_) savedfocus_ = 0; @@ -551,5 +552,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const { } // -// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.7 2001/12/19 18:40:13 easysw Exp $". +// End of "$Id: Fl_Group.cxx,v 1.8.2.8.2.8 2001/12/20 14:41:44 easysw Exp $". // |
