Browse Source

Remove redundant Fl_Group::clear() from ~Fl_Scroll()

Fl_Group::clear() is called in Fl_Group's d'tor anyway.

Technically we don't need to remove hscrollbar and scrollbar because
they are destroyed (and thus removed from Fl_Group) before Fl_Group's
d'tor is executed but this is left for clarity and to guarantee the
order (see comment).
pull/1246/head
Albrecht Schlosser 2 months ago
parent
commit
fb48bc22cc
  1. 3
      src/Fl_Scroll.cxx

3
src/Fl_Scroll.cxx

@ -1,7 +1,7 @@
// //
// Fl_Scroll widget for the Fast Light Tool Kit (FLTK). // Fl_Scroll widget for the Fast Light Tool Kit (FLTK).
// //
// Copyright 1998-2022 by Bill Spitzak and others. // Copyright 1998-2025 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@ -41,7 +41,6 @@ void Fl_Scroll::clear() {
Fl_Scroll::~Fl_Scroll() { Fl_Scroll::~Fl_Scroll() {
remove(hscrollbar); // remove last child first remove(hscrollbar); // remove last child first
remove(scrollbar); remove(scrollbar);
Fl_Group::clear();
} }
/** Ensure the scrollbars are the last children. /** Ensure the scrollbars are the last children.

Loading…
Cancel
Save