1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 18:16:38 +02:00

Always unload socketengines/database/protocl etc modules last, and fixed a potential crash in m_mysql when unloading when not in GDB

This commit is contained in:
Adam
2010-08-17 22:19:36 -04:00
parent fa7684b3a3
commit b180d5f975
6 changed files with 22 additions and 18 deletions
+8 -6
View File
@@ -419,16 +419,18 @@ void ModuleManager::ClearCallBacks(Module *m)
/** Unloading all modules, NEVER call this when Anope isn't shutting down.
* Ever.
* @param unload_proto true to unload the protocol module
*/
void ModuleManager::UnloadAll(bool unload_proto)
void ModuleManager::UnloadAll()
{
for (std::list<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; )
for (size_t i = MT_BEGIN + 1; i != MT_END; ++i)
{
Module *m = *it++;
for (std::list<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; )
{
Module *m = *it++;
if (unload_proto || m->type != PROTOCOL)
DeleteModule(m);
if (static_cast<MODType>(i) == m->type)
DeleteModule(m);
}
}
}