From 7ae0c170ad2f63ac7e27d0496cd9c167e2bd0cbd Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 20 Feb 2010 17:40:07 +0000 Subject: Added Fl_Widget_Tracker in handle() methods etc. to avoid accessing widgets after deletion (STR #1306). This is all I could find, but maybe there are more places in the code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7115 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Group.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Fl_Group.cxx') diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index b42f1caf8..4deba31ce 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -227,8 +227,9 @@ int Fl_Group::handle(int event) { for (i = children(); i--;) { o = a[i]; if (o->takesevents() && Fl::event_inside(o)) { + Fl_Widget_Tracker wp(o); if (send(o,FL_PUSH)) { - if (Fl::pushed() && !o->contains(Fl::pushed())) Fl::pushed(o); + if (Fl::pushed() && wp.exists() && !o->contains(Fl::pushed())) Fl::pushed(o); return 1; } } -- cgit v1.2.3