diff options
author | Adam <Adam@anope.org> | 2013-07-20 23:36:20 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-20 23:36:20 -0400 |
commit | 7480fbda2b308b914e942d36e9a29a9f7d7a5d5a (patch) | |
tree | 75cc4a511324fd2e80c0e49600878363a909df50 /modules/extra/m_mysql.cpp | |
parent | 9629ccb3745ed069ae906b7314638a5a0d9e2fa5 (diff) |
Fix removing old connections in m_ldap and m_mysql
Diffstat (limited to 'modules/extra/m_mysql.cpp')
-rw-r--r-- | modules/extra/m_mysql.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 79198a814..3ca8404ba 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -188,20 +188,21 @@ class ModuleSQL : public Module, public Pipe void OnReload(Configuration::Conf *conf) anope_override { - Configuration::Block *config = Config->GetModule(this); - int i; + Configuration::Block *config = conf->GetModule(this); for (std::map<Anope::string, MySQLService *>::iterator it = this->MySQLServices.begin(); it != this->MySQLServices.end();) { const Anope::string &cname = it->first; MySQLService *s = it->second; + int i; + ++it; - for (i = 0; i < Config->CountBlock("mysql"); ++i) - if (Config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname) + for (i = 0; i < config->CountBlock("mysql"); ++i) + if (config->GetBlock("mysql", i)->Get<const Anope::string>("name", "main") == cname) break; - if (i == Config->CountBlock("mysql")) + if (i == config->CountBlock("mysql")) { Log(LOG_NORMAL, "mysql") << "MySQL: Removing server connection " << cname; @@ -210,7 +211,7 @@ class ModuleSQL : public Module, public Pipe } } - for (i = 0; i < config->CountBlock("mysql"); ++i) + for (int i = 0; i < config->CountBlock("mysql"); ++i) { Configuration::Block *block = config->GetBlock("mysql", i); const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main"); |