mirror of https://github.com/fltk/fltk
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.
This commit is contained in:
parent
b8318480f5
commit
a7a1e1594c
|
@ -452,6 +452,8 @@ void Fl_Group::clear() {
|
|||
widgets' destructors would be called twice!
|
||||
*/
|
||||
Fl_Group::~Fl_Group() {
|
||||
if (current_ == this)
|
||||
end();
|
||||
clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue