Speed up automation lane removal with many ctrl points

Deleting the group first, directly removes child items
without triggering Canvas::item_changed() for every item.

This significantly speeds up closing sessions (or deleting tracks)
with lots of automation events.
This commit is contained in:
Robin Gareus 2020-05-20 01:02:36 +02:00
parent 6c72862801
commit 6ada6c553b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 10 additions and 2 deletions

View File

@ -131,8 +131,13 @@ AutomationLine::AutomationLine (const string& name,
AutomationLine::~AutomationLine ()
{
vector_delete (&control_points);
delete group;
delete group; // deletes child items
for (std::vector<ControlPoint *>::iterator i = control_points.begin(); i != control_points.end(); i++) {
(*i)->unset_item ();
delete *i;
}
control_points.clear ();
if (_our_time_converter) {
delete _time_converter;

View File

@ -79,6 +79,9 @@ public:
ArdourCanvas::Item& item() const;
/* used from ~AutomationLine */
void unset_item () { _item = 0 ; }
ARDOUR::AutomationList::iterator model() const { return _model; }
AutomationLine& line() const { return _line; }