Fix crash when touching stale Automation Points

Undo/Redo allows to change a region's envelope without the envelope-list
changing (AutomationList::StateChanged is not emitted).

This also catches other operations where region-length can change while
the Envelope is visible. -- Normally when using the range or object tool
to modify a Region, the Envelope is not visible.

Without this change it was possible that the GUI shows automation
points that don't have a corresponding libardour representation:

e.g. select range, change tool to "draw", press "s" (split), undo,
click on any region-gain point.
This commit is contained in:
Robin Gareus 2019-02-15 21:37:19 +01:00
parent a858f199a1
commit 1d6ee0b7e2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 8 additions and 0 deletions

View File

@ -110,4 +110,12 @@ AudioRegionGainLine::region_changed (const PropertyChange& what_changed)
if (what_changed.contains (interesting_stuff)) {
_time_converter->set_origin_b (rv.region()->position());
}
interesting_stuff.clear ();
interesting_stuff.add (ARDOUR::Properties::start);
interesting_stuff.add (ARDOUR::Properties::length);
if (what_changed.contains (interesting_stuff)) {
reset ();
}
}