diff --git a/libs/ardour/monitor_port.cc b/libs/ardour/monitor_port.cc index 45db2addb1..6dd6588155 100644 --- a/libs/ardour/monitor_port.cc +++ b/libs/ardour/monitor_port.cc @@ -338,6 +338,11 @@ MonitorPort::clear_ports (bool instantly) MonitorInputChanged (i->first, false); /* EMIT SIGNAL */ } + if (instantly) { + /* release shared_ptr references */ + _monitor_ports.flush (); + } + if (!s) { return; } diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 7da3445f8f..db611aec91 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -1158,6 +1158,9 @@ PortManager::update_input_ports (bool clear) * do this when called from ::reestablish_ports() * "JACK: Cannot connect ports owned by inactive clients" */ + /* .. but take the opportunity to clear out dead wood */ + _audio_input_ports.flush (); + _midi_input_ports.flush (); return; } diff --git a/libs/ardour/session_bundles.cc b/libs/ardour/session_bundles.cc index e0bd838460..558c63716c 100644 --- a/libs/ardour/session_bundles.cc +++ b/libs/ardour/session_bundles.cc @@ -75,6 +75,7 @@ Session::remove_bundle (std::shared_ptr bundle) if (removed) { BundleAddedOrRemoved (); /* EMIT SIGNAL */ + _bundles.flush (); } set_dirty();