diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-02-20 17:40:07 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2010-02-20 17:40:07 +0000 |
| commit | 7ae0c170ad2f63ac7e27d0496cd9c167e2bd0cbd (patch) | |
| tree | 0d51f2e36cc11714c6ee5923f8d52c6a9a3793dc /FL/Fl_Input_Choice.H | |
| parent | c7a1aead4c9b79882b64267b492b1f9d87ab22d0 (diff) | |
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
Diffstat (limited to 'FL/Fl_Input_Choice.H')
| -rw-r--r-- | FL/Fl_Input_Choice.H | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index a5d025523..0010ea336 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -76,6 +76,7 @@ class Fl_Input_Choice : public Fl_Group { static void menu_cb(Fl_Widget*, void *data) { Fl_Input_Choice *o=(Fl_Input_Choice *)data; + Fl_Widget_Tracker wp(o); const Fl_Menu_Item *item = o->menubutton()->mvalue(); if (item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER)) return; // ignore submenus if (!strcmp(o->inp_->value(), o->menu_->text())) @@ -92,6 +93,8 @@ class Fl_Input_Choice : public Fl_Group { if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE)) o->do_callback(); } + + if (wp.deleted()) return; if (o->callback() != default_callback) { @@ -102,6 +105,7 @@ class Fl_Input_Choice : public Fl_Group { static void inp_cb(Fl_Widget*, void *data) { Fl_Input_Choice *o=(Fl_Input_Choice *)data; + Fl_Widget_Tracker wp(o); if (o->inp_->changed()) { o->Fl_Widget::set_changed(); if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE)) @@ -111,6 +115,8 @@ class Fl_Input_Choice : public Fl_Group { if (o->when() & FL_WHEN_NOT_CHANGED) o->do_callback(); } + + if (wp.deleted()) return; if (o->callback() != default_callback) o->Fl_Widget::clear_changed(); |
