fix for potentially skipped entries in cleanConnections()
This commit is contained in:
@@ -291,13 +291,15 @@ void Network::run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Network::cleanConnections() {
|
void Network::cleanConnections() {
|
||||||
list<Connection*>::iterator c_it;
|
list<Connection*>::iterator c_it = m_connections.begin();
|
||||||
for (c_it = m_connections.begin(); c_it != m_connections.end(); c_it++) {
|
while (c_it != m_connections.end()) {
|
||||||
if (!(*c_it)->isRunning()) {
|
if (!(*c_it)->isRunning()) {
|
||||||
Connection* connection = *c_it;
|
Connection* connection = *c_it;
|
||||||
c_it = m_connections.erase(c_it);
|
c_it = m_connections.erase(c_it);
|
||||||
delete connection;
|
delete connection;
|
||||||
logDebug(lf_network, "dead connection removed - %d", m_connections.size());
|
logDebug(lf_network, "dead connection removed - %d", m_connections.size());
|
||||||
|
} else {
|
||||||
|
c_it++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user