diff options
author | Robin Gareus <robin@gareus.org> | 2019-09-05 18:59:26 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-09-05 18:59:26 +0200 |
commit | 9bb2f2bb6994586e77caed9cdee40607d370e428 (patch) | |
tree | da48cbe08f29d63660f21989080c12697a10ed6a /libs/ardour/control_protocol_manager.cc | |
parent | 22e5c1de0d9a090a67103050cc781d9577a8eb7f (diff) |
Prevent duplicate Ctrl-protocol instances
ControlProtocols are single instance.
Activating an already active protocol leads to crashes due to
various rasons (e.g. port already registered), re-used singleton
event_loop_name and request-buffers, duplicate free of
AbstractUI request buffers during deactivate,..
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index eabc4e5006..c7be44a4c8 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -129,6 +129,11 @@ ControlProtocolManager::activate (ControlProtocolInfo& cpi) cpi.requested = true; + if (cpi.protocol && cpi.protocol->active()) { + warning << string_compose (_("Control protocol %1 was already active."), cpi.name) << endmsg; + return 0; + } + if ((cp = instantiate (cpi)) == 0) { return -1; } |