From 8c34dc0cc836e83d577ab402d0ae0a557b31d9b7 Mon Sep 17 00:00:00 2001 From: Jackmcbarn Date: Thu, 2 Dec 2010 08:51:00 -0500 Subject: Simplify ClearAllConnections code and fix possible crash --- src/modules/extra/m_mssql.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 7561fb2d8..cf94d4389 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -770,12 +770,9 @@ class ModuleMsSQL : public Module void ClearAllConnections() { - ConnMap::iterator i; - while ((i = connections.begin()) != connections.end()) - { - connections.erase(i); + for(ConnMap::iterator i = connections.begin(); i != connections.end(); ++i) delete i->second; - } + connections.clear(); } virtual void OnRehash(User* user) -- cgit v1.2.3