diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index aa663919f..f5a2d02ea 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -389,22 +389,22 @@ void Fl_Group::clear() { if (contains(pushed)) pushed = this; // set it to be the group, if it's a child Fl::pushed(this); // for fl_fix_focus etc. - // okay, now it is safe to destroy the children: + // Implementation note (AlbrechtS, Nov. 01, 2022): + // For some obscure reason the order of all children had been + // reversed in FLTK 1.3.x so the first child would be deleted + // first but this is no longer done since FLTK 1.4.0. + // Reasoning: + // (1) it is supposedly better to remove children in the + // order "last in, first out" + // (2) it would not be compatible with the new subclass + // notification feature Fl_Group::on_remove(). + // See git commit a918292547cfb154 or earlier for removed code. + // End of implementation note. -#define REVERSE_CHILDREN -#ifdef REVERSE_CHILDREN - // Reverse the order of the children. Doing this and deleting - // always the last child is much faster than the other way around. - if (children_ > 1) { - Fl_Widget *temp; - Fl_Widget **a = (Fl_Widget**)array(); - for (int i=0,j=children_-1; i