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
This commit is contained in:
Paul Davis 2019-10-28 11:15:07 -06:00
parent 5e9e7e6ed4
commit 7f1134e550
1 changed files with 4 additions and 5 deletions

View File

@ -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) {