diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-06-15 01:38:18 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-06-15 01:38:18 +0200 |
| commit | a7a1e1594c7c574b135a99f80edbf47a7352e974 (patch) | |
| tree | 92bcc6ae40e9dd3726968a352f22d61796b24e14 /src | |
| parent | b8318480f515c9ca0e7257ca7ca4c73c56a4a080 (diff) | |
Fix stale current_ pointer when deleting Fl_Group
If a user program accidentally deletes the "current" group, then
the pointer would still point at the deleted widget. This commit
prevents this and makes the Fl_Group's parent the current group.
Fixes issue #88.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Group.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index aefead997..2ec83d493 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -452,6 +452,8 @@ void Fl_Group::clear() { widgets' destructors would be called twice! */ Fl_Group::~Fl_Group() { + if (current_ == this) + end(); clear(); } |
