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/extra/m_mysql.cpp | |
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/extra/m_mysql.cpp')
-rw-r--r-- | modules/extra/m_mysql.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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) |