mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 17:16:38 +01:00
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,..
This commit is contained in:
parent
22e5c1de0d
commit
9bb2f2bb69
1 changed files with 5 additions and 0 deletions
|
|
@ -129,6 +129,11 @@ ControlProtocolManager::activate (ControlProtocolInfo& cpi)
|
||||||
|
|
||||||
cpi.requested = true;
|
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) {
|
if ((cp = instantiate (cpi)) == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue