| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3375
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 4 - High, e.g. key functionality not working |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | Fl_Tree segmentation fault after item deleting and clicking at special place |
Version: | 1.3.4 |
Created By: | kmxm |
Assigned To: | greg.ercolano |
Fix Version: | 1.4.0 |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | kmxm 13:04 Apr 17, 2017 |
| Fl_Tree causes segmentation fault when clicking special place (see picture) after item has been deleted. Problem arises not only in my application but in standard examples too. I have recognized that problem is in '_lastselect' field. This field defined as static in Fl_Tree::handle() an stores link to item that may become deleted. I have workaround this by defining '_lastselect' as class protected member and setting it to 0 after remove() or clear_children(). It looks like same problem can take place for '_item_focus'. | |
|
#2 | greg.ercolano 03:47 Oct 08, 2017 |
| Assigning to myself. Will try to look into it this week. | |
|
#3 | greg.ercolano 16:46 Oct 08, 2017 |
| You have the right idea, and I'm pretty sure this has already been addressed.
If you're using 1.3.4, try putting this #define in the FL/abi_version.h file:
#define FL_ABI_VERSION 10304
..and rebuild FLTK. This should enable ABI breaking features, which should do pretty much what your workaround is.
Both _lastselect and _item_focus are now private class members, both set to NULL when remove()ed, which should prevent the problem you describe.
In 1.4.x this is the default, no ABI settings are needed.
Leaving this open for a reply, and will close if you can confirm. Will close automatically after a few weeks if there's no reply. | |
|
#4 | greg.ercolano 10:19 Oct 20, 2017 |
| This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.
Solution described in #3 should work; either use 1.4.x or enable ABI features in 1.3.x
If that's not it, please request we re-open STR #3375 with any added details. | |
[ Return to Bugs & Features ]
|
| |