summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-05-20 01:02:36 +0200
committerRobin Gareus <robin@gareus.org>2020-05-20 01:02:36 +0200
commit6ada6c553bec3b43a6c92aaa364cd4da20f1315b (patch)
tree447cb47bfc207043ef28a508b3fb414072967834 /gtk2_ardour/automation_line.cc
parent6c728628011d01a8e04a706742a894a96dd9edc8 (diff)
Speed up automation lane removal with many ctrl points6.0-rc2
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.
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 34d59ef581..802c29cf01 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -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;