Repository navigation
Fix crash when removing a list item of a parameter - #1188
Merged
Merged
Conversation
Contributor
Author
|
Superseds on #1104. |
and report them
rodolforg
force-pushed
the
fix-remove-parameter-list-item
branch
from
February 29, 2020 20:20
a7f231f to
84b3e6c
Compare
Collaborator
|
@blackwarthog found a deeper problem, so i will continue to review after he take decision to use hack or fix original problem. |
Contributor
Author
|
@ice0 This PR just avoids Synfig Studio from crashing. Crash yells a bad reputation for the software: work hour loss :( The problem root seems to be bad (or none) reaction to item removal of parameter list: connected signals and queued redrawing before internal (studio) structure/data update. |
Collaborator
|
@rodolforg I agree. Just want to check if better solution is possible. Anyway we do not release, until this issue is closed. |
Collaborator
|
After call method LayerParamTreeStore::rebuild() does the following:
- called LayerParamTreeStore
- items from tree removes one by one
- after removing of selected item section moves to the next item and calling signal_selection_changed()
- Dock_Curves listen this signal and initiates of redraw
- error raised when selection moved to last element in list, because curretly list have a one item less
also this behavior produse a lot of extra calls of signal_selection_changed and a lot of repaints of GUI.
GTK cannot handle this situation because TreeStore (child of TreeModel) does not know nothing about widgets and selection
TreeView widget and Selection does not know when TreeStore cleared
GTK have no signal on TreeModel completely clears, it replaced by one by one calling of item removing signals
We need to safely clear th TreeStore when its content was invalidated.
But GTK assumes that item will removed from model *before* removing from user logic.
So by GTK assumed workflow we need to keep model and linked with it user data in valid state.
We have ability to remove a single item, but it have some ancient problems. Developers before us was disabled this code, and just do full rebuild of the tree. Will be goot to fix it in future.
But anyway we need an ability to do full rebuild safely.
Solution can be in adding of our own signal_clearing into LayerParamTreeStore, and connect widget to it, to clear the selection before clearing of TreeStore.
|
Collaborator
|
Merged. Thank you! |
Collaborator
|
Created a new issue to find the better solution later: #1287 |
morevnaproject
pushed a commit
that referenced
this pull request
Mar 26, 2020
…#1188) * fix crash when removing a list item of a parameter * avoid some possible null dereferences in invalid valuenodes and report them * fix missing explicit initializer
morevnaproject
pushed a commit
that referenced
this pull request
Mar 26, 2020
…#1188) * fix crash when removing a list item of a parameter * avoid some possible null dereferences in invalid valuenodes and report them * fix missing explicit initializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you select a vertex item of Spline parameter list and then right-click on it and choose
Remove item (Smart), app crashes.Not anymore. Simple, but not the best, solution.