summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-08-24 18:21:08 +0200
committerRobin Gareus <robin@gareus.org>2019-08-24 18:24:21 +0200
commit629289dc4aa2fb86896ea2c969051bd0f3e4c4c9 (patch)
tree1ffe5ea584eea8e737a92df15eae1a3871d925e6
parent9ce5184993c1b571981138f1dd0dfb80c9fcf028 (diff)
Fix crash when selected automation-lane is removed
When a plugin is deleted, automation-lanes of the given plugin are removed, but previously a pointed to the deleted lane remained in the selection. This caused crashes later when the track selection is used. e.g. during sensitize_the_right_region_actions() Note that ~TimeAxisView() also emits CatchDeletion (this); however "this" fails to be dynamic_cast<AutomationTimeAxisView*> because that d'tor has already been completed.
-rw-r--r--gtk2_ardour/automation_time_axis.cc1
-rw-r--r--gtk2_ardour/editor.cc5
2 files changed, 6 insertions, 0 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 09f2e409b1..92af663e76 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -332,6 +332,7 @@ AutomationTimeAxisView::~AutomationTimeAxisView ()
cleanup_gui_properties ();
}
delete _view;
+ CatchDeletion (this);
}
void
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index fc74837739..1693ddae05 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -5543,6 +5543,11 @@ Editor::timeaxisview_deleted (TimeAxisView *tv)
ENSURE_GUI_THREAD (*this, &Editor::timeaxisview_deleted, tv);
+ if (dynamic_cast<AutomationTimeAxisView*> (tv)) {
+ selection->remove (tv);
+ return;
+ }
+
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (tv);
_routes->route_removed (tv);