Fixed controller breaking when all connectors are deleted simultaneously.
This commit is contained in:
parent
a389234224
commit
2f4a4660d0
1 changed files with 13 additions and 8 deletions
|
@ -139,15 +139,20 @@ namespace Controller {
|
||||||
bool action = false;
|
bool action = false;
|
||||||
//shut down deleted/changed connectors
|
//shut down deleted/changed connectors
|
||||||
std::map<std::string, pid_t>::iterator it;
|
std::map<std::string, pid_t>::iterator it;
|
||||||
for (it = currentConnectors.begin(); it != currentConnectors.end(); it++){
|
if (currentConnectors.size()){
|
||||||
if (!runningConns.count(it->first)){
|
for (it = currentConnectors.begin(); it != currentConnectors.end(); it++){
|
||||||
if (Util::Procs::isActive(it->second)){
|
if (!runningConns.count(it->first)){
|
||||||
Log("CONF", "Stopping connector " + it->first);
|
if (Util::Procs::isActive(it->second)){
|
||||||
action = true;
|
Log("CONF", "Stopping connector " + it->first);
|
||||||
Util::Procs::Stop(it->second);
|
action = true;
|
||||||
|
Util::Procs::Stop(it->second);
|
||||||
|
}
|
||||||
|
currentConnectors.erase(it);
|
||||||
|
if (!currentConnectors.size()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
it = currentConnectors.begin();
|
||||||
}
|
}
|
||||||
currentConnectors.erase(it);
|
|
||||||
it = currentConnectors.begin();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue