mirror of
https://github.com/fltk/fltk.git
synced 2026-05-29 04:26:27 +08:00
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:
@@ -452,6 +452,8 @@ void Fl_Group::clear() {
|
|||||||
widgets' destructors would be called twice!
|
widgets' destructors would be called twice!
|
||||||
*/
|
*/
|
||||||
Fl_Group::~Fl_Group() {
|
Fl_Group::~Fl_Group() {
|
||||||
|
if (current_ == this)
|
||||||
|
end();
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user