summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_port.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-10-13 17:18:42 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-10-13 17:18:54 -0400
commit8f9a9523d2161ee15975f5f9136ef80d4bfbf3e2 (patch)
treefa82656ffa02c7e9d8a959803f501ab95fcbd482 /libs/ardour/midi_port.cc
parent1552547f650a82487ac72615c8533fd25b4ffc39 (diff)
new scheme for managing port deletion
shared_ptr<Port> now uses a deleter functor which pushes Port* to a lock-free FIFO so that the Port is always deleted (and thus unregistered with the PortEngine/backend) in a safe context w.r.t. various callbacks in the host. Currently the auto_connect_thread in Session has been tasked with doing these deletions.
Diffstat (limited to 'libs/ardour/midi_port.cc')
-rw-r--r--libs/ardour/midi_port.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index c490fb9570..f3f5378f5b 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -49,7 +49,8 @@ MidiPort::MidiPort (const std::string& name, PortFlags flags)
MidiPort::~MidiPort()
{
if (_shadow_port) {
- _shadow_port->disconnect_all ();
+ AudioEngine::instance()->unregister_port (_shadow_port);
+ _shadow_port.reset ();
}
delete _buffer;