diff options
author | Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org> | 2010-12-02 08:51:00 -0500 |
---|---|---|
committer | Jackmcbarn <jackmcbarn@jackmcbarn.no-ip.org> | 2010-12-02 08:51:00 -0500 |
commit | 8c34dc0cc836e83d577ab402d0ae0a557b31d9b7 (patch) | |
tree | b0dc7deaf2fb04e4f4b0cdb3970cbede2592f0e9 /src | |
parent | 017ec10c51eb81c85703cb0dad4a58b7954d0fd3 (diff) |
Simplify ClearAllConnections code and fix possible crash
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_mssql.cpp | 7 |
1 files 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) |