From 4b75ed249ea914feff6e711301c53e21b858cf15 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 27 Jul 2024 22:25:09 +0200 Subject: [PATCH] Unregister ports directly after RCU update see also 2e23ec4422c3. This fixes a bug where some ports remain in used (shared_ptr) by the RCUManager, even after the port is removed from the port_map. This can lead to issues when the port is re-registered later. --- libs/ardour/io.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 4a02c155cc..b334fbc625 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -445,10 +445,12 @@ IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed) /* end of RCUWriter scope */ } + if (changed) { const ChanCount n_ports = ports ()->count (); PortCountChanged (n_ports); /* EMIT SIGNAL */ _session.set_dirty (); + _ports.flush (); } if (clear) {