From d0c934a9de31df9ea0f6046fa074ea9fe17e8b07 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 3 Aug 2017 18:43:12 +0200 Subject: Fix crash when cleaning up w/o destroying session - Control-protocols may transmit data during cleanup (e.g. reset surface), and need the Audio-engine to do so. - destroying the ControlProtocolManager w/o the Session calling ::drop_protocols(), lead to a double free. --- libs/ardour/control_protocol_manager.cc | 1 + libs/ardour/globals.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 8616848467..bd5b7e72a6 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -76,6 +76,7 @@ ControlProtocolManager::~ControlProtocolManager() for (list::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) { + (*p)->protocol = 0; // protocol was already destroyed above. delete (*p); } diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 28eb818921..00d448985f 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -597,13 +597,13 @@ ARDOUR::cleanup () return; } + delete &ControlProtocolManager::instance(); ARDOUR::AudioEngine::destroy (); delete Library; #ifdef HAVE_LRDF lrdf_cleanup (); #endif - delete &ControlProtocolManager::instance(); #ifdef WINDOWS_VST_SUPPORT fst_exit (); #endif -- cgit v1.2.3