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_Dial.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Fl_Dial.cxx') diff --git a/src/Fl_Dial.cxx b/src/Fl_Dial.cxx index f91b55df9..fed278ca3 100644 --- a/src/Fl_Dial.cxx +++ b/src/Fl_Dial.cxx @@ -109,8 +109,10 @@ void Fl_Dial::draw() { */ int Fl_Dial::handle(int event, int X, int Y, int W, int H) { switch (event) { - case FL_PUSH: + case FL_PUSH: { + Fl_Widget_Tracker wp(this); handle_push(); + if (wp.deleted()) return 1; } case FL_DRAG: { int mx = (Fl::event_x()-X-W/2)*H; int my = (Fl::event_y()-Y-H/2)*W; -- cgit v1.2.3