13
0

Drop some shared pointer references after RCU writes

When removing instances from some RCU managed list or vector,
they can still live on as shared_ptr references on the
RCU's dead wood stack.

In many cases this is not an issue, in these cases it's prudent.

see also 44610c7877
This commit is contained in:
Robin Gareus 2024-08-21 03:47:40 +02:00
parent 4d1d938263
commit 908a402a75
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 9 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -75,6 +75,7 @@ Session::remove_bundle (std::shared_ptr<Bundle> bundle)
if (removed) {
BundleAddedOrRemoved (); /* EMIT SIGNAL */
_bundles.flush ();
}
set_dirty();