summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-03-22 21:54:49 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-03-22 21:54:49 +0000
commit19963bd452eac3c9fc52b3ee60fbf1a81efed7d3 (patch)
tree4a8aef0866135ff7cd133025749f16662062066c /src/modules
parent2bde76b587156e34820b2d3bfeae946fa735a066 (diff)
Fix MySQL crash on module unload with empty query queue
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12652 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_mysql.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index d58b762ae..236cb4349 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -445,8 +445,10 @@ void ModuleSQL::OnUnloadModule(Module* mod)
{
SQLerror err(SQL_BAD_DBID);
Dispatcher->LockQueue();
- for(unsigned int i = qq.size() - 1; i >= 0; i--)
+ unsigned int i = qq.size();
+ while (i > 0)
{
+ i--;
if (qq[i].q->creator == mod)
{
if (i == 0)