From 19963bd452eac3c9fc52b3ee60fbf1a81efed7d3 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 22 Mar 2010 21:54:49 +0000 Subject: 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 --- src/modules/extra/m_mysql.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules/extra') 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) -- cgit v1.2.3