summaryrefslogtreecommitdiff
path: root/modules/extra/m_async_commands.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-25 15:58:46 -0400
committerAdam <Adam@anope.org>2011-04-25 15:58:46 -0400
commit0cdc628db05cc7391c6114c46c52d65d90603571 (patch)
tree5f985f006e2df90488c283fff639f88a5d9cef68 /modules/extra/m_async_commands.cpp
parent4a733c93d45e0ca5d757abf826d65bc1cbaf610e (diff)
Fixed crash when certain nicks expire
Diffstat (limited to 'modules/extra/m_async_commands.cpp')
-rw-r--r--modules/extra/m_async_commands.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/extra/m_async_commands.cpp b/modules/extra/m_async_commands.cpp
index 7e1b24f34..b2c552351 100644
--- a/modules/extra/m_async_commands.cpp
+++ b/modules/extra/m_async_commands.cpp
@@ -138,10 +138,7 @@ class ModuleAsynchCommands : public Module, public Pipe, public AsynchCommandsSe
cm->Destroy();
}
- if (current_command == NULL)
- this->Reset();
- else
- this->reset = true;
+ this->reset = true;
}
EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params)
@@ -189,10 +186,18 @@ class ModuleAsynchCommands : public Module, public Pipe, public AsynchCommandsSe
else if (cm->destroy)
{
if (cm->started)
+ {
cm->mutex.Unlock();
+ continue;
+ }
else
delete cm;
- continue;
+ }
+
+ if (this->reset)
+ {
+ this->Reset();
+ return this->OnNotify();
}
Log(LOG_DEBUG_2) << "Waiting for command thread " << cm->command->name << " from " << cm->source.u->nick;
@@ -220,12 +225,6 @@ class ModuleAsynchCommands : public Module, public Pipe, public AsynchCommandsSe
PopLanguage();
current_command = NULL;
-
- if (this->reset)
- {
- this->Reset();
- return this->OnNotify();
- }
}
}