Please sign in to comment.
Fix a crash resulting from corrupted undo stack (fixes #11940)
In field calc opened from attribute table, when changing attributes there is a series of signals: layer emits attributeValueChanged(), cache forces update of attribute table data, which at one point calls layer.isModified(), emitting beforeModifiedCheck() - in turn calling save() of attribute form, which would change first feature's new attribute to a bogus value. This recursive change of attribute values corrupts the undo stack. The fix pre-sets the feature's attribute so that no dummy entry is added to the undo stack. In the future we should probably try to improve the whole cascade to avoid bugs like this one: 1. if possible, make emission of edit signals "safe", so a slot can do more editing calls without corrupting undo stack 2. get rid of beforeModifiedCheck() signal as it adds quite surprising behavior (and overhead) to what should be a simple check
- Loading branch information