From 964b88e651ac3324d85f735aad3faba226b582f6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 28 Jul 2017 20:11:55 +0200 Subject: Delete CoreSelection at session close --- libs/ardour/automation_control.cc | 4 +++- libs/ardour/session.cc | 4 ++++ libs/ardour/stripable.cc | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 9b7628a7ad..1c4525470b 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -70,7 +70,9 @@ AutomationControl::AutomationControl(ARDOUR::Session& s AutomationControl::~AutomationControl () { - _session.selection().remove_control_by_id (id()); + if (!_session.deletion_in_progress ()) { + _session.selection().remove_control_by_id (id()); + } DropReferences (); /* EMIT SIGNAL */ } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 04c8770a78..0616c364d9 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -836,6 +836,10 @@ Session::destroy () AudioEngine::instance()->clear_pending_port_deletions (); } + DEBUG_TRACE (DEBUG::Destruction, "delete selection\n"); + delete _selection; + _selection = 0; + DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n"); BOOST_SHOW_POINTERS (); diff --git a/libs/ardour/stripable.cc b/libs/ardour/stripable.cc index 9f5a5743e7..24167438c3 100644 --- a/libs/ardour/stripable.cc +++ b/libs/ardour/stripable.cc @@ -44,7 +44,9 @@ Stripable::Stripable (Session& s, string const & name, PresentationInfo const & Stripable::~Stripable () { - _session.selection().remove_stripable_by_id (id()); + if (!_session.deletion_in_progress ()) { + _session.selection().remove_stripable_by_id (id()); + } } void -- cgit v1.2.3