|
|
Thanks all; wow, that's a sneaky case to clear the root during the recursion to handle(FL_FOCUS).
Doing that second test for _root == NULL shows how this problem can crop up anywhere, so perhaps doing anything directly with _root is inherently dangerous.
Changing _root->find_clicked() to just find_clicked() fixes the problem too, as it does the same operation and includes the check for (_root == NULL) in the method, so that's a cleaner solution, e.g.
- Fl_Tree_Item *item = _root->find_clicked(_prefs, 0);
+ Fl_Tree_Item *item = find_clicked(0); // #971
And in fact that pattern should be applied throughout the handle() method wherever _root->find_clicked() is used. I'll try applying that later today; I'm not quite awake yet.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/971/2100550524@github.com>
[ Direct Link to Message ] | |
|
| |