diff options
| author | Adam <Adam@anope.org> | 2010-08-17 22:19:36 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-08-17 22:19:36 -0400 |
| commit | b180d5f975b3fd9a096a712adf9589c360831f72 (patch) | |
| tree | 34952f6bb9d25653f43c90a9ca603214af4ca52c /modules | |
| parent | fa7684b3a3eea24ab72549aded6466eb0bede5fb (diff) | |
Always unload socketengines/database/protocl etc modules last, and fixed a potential crash in m_mysql when unloading when not in GDB
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/core/os_modlist.cpp | 2 | ||||
| -rw-r--r-- | modules/extra/db_mysql.cpp | 2 | ||||
| -rw-r--r-- | modules/extra/m_mysql.cpp | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/modules/core/os_modlist.cpp b/modules/core/os_modlist.cpp index bdd7d3f19..58cd2d6c6 100644 --- a/modules/core/os_modlist.cpp +++ b/modules/core/os_modlist.cpp @@ -193,6 +193,8 @@ class CommandOSModList : public Command ++count; } break; + default: + break; } } if (!count) diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index 7bc48230f..27a1226d1 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -365,6 +365,8 @@ class DBMySQL : public Module { me = this; + this->SetType(DATABASE); + this->lastwarn = 0; this->ro = false; diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 72176fa70..176899a1b 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -187,8 +187,7 @@ class ModuleSQL : public Module DThread->Wakeup(); DThread->Join(); - if (SocketEngine) - delete SQLPipe; + delete SQLPipe; } void OnReload(bool startup) @@ -278,9 +277,10 @@ MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::strin MySQLService::~MySQLService() { + me->DThread->Lock(); this->Lock.Lock(); - this->Lock.Unlock(); mysql_close(this->sql); + this->sql = NULL; for (unsigned i = me->QueryRequests.size(); i > 0; --i) { @@ -293,6 +293,8 @@ MySQLService::~MySQLService() me->QueryRequests.erase(me->QueryRequests.begin() + i); } } + this->Lock.Unlock(); + me->DThread->Unlock(); } void MySQLService::Run(SQLInterface *i, const Anope::string &query) |
