From 7f1134e5509d96bd34364f71e5133cddbb1f3926 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 28 Oct 2019 11:15:07 -0600 Subject: [PATCH] move reset (deletion) of click_io and ltc_output objects until after we are disconnected from the engine We use those objects unconditionally and without caching inside process(), which could be invoked by the engine during their deletion --- libs/ardour/session.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 6d698988f3..c3035d4b5c 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -562,11 +562,6 @@ Session::destroy () /* shutdown control surface protocols while we still have ports * and the engine to move data to any devices. */ - - /* remove I/O objects before unsetting the engine session */ - _click_io.reset (); - _ltc_output.reset (); - ControlProtocolManager::instance().drop_protocols (); /* stop auto dis/connecting */ @@ -582,6 +577,10 @@ Session::destroy () Port::PortDrop (); /* EMIT SIGNAL */ + /* remove I/O objects that we (the session) own */ + _click_io.reset (); + _ltc_output.reset (); + { Glib::Threads::Mutex::Lock lm (controllables_lock); for (Controllables::iterator i = controllables.begin(); i != controllables.end(); ++i) { -- 2.30.2