From 629289dc4aa2fb86896ea2c969051bd0f3e4c4c9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 24 Aug 2019 18:21:08 +0200 Subject: [PATCH] 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 because that d'tor has already been completed. --- gtk2_ardour/automation_time_axis.cc | 1 + gtk2_ardour/editor.cc | 5 +++++ 2 files changed, 6 insertions(+) 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 (tv)) { + selection->remove (tv); + return; + } + RouteTimeAxisView* rtav = dynamic_cast (tv); _routes->route_removed (tv);