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
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user