summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 2fb8a23..e059764 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -99,9 +99,14 @@ void XmppComponent::shutdown()
void XmppComponent::clean()
{
- for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it)
+ auto it = this->bridges.begin();
+ while (it != this->bridges.end())
{
it->second->clean();
+ if (it->second->connected_clients() == 0)
+ it = this->bridges.erase(it);
+ else
+ ++it;
}
}