summaryrefslogtreecommitdiff
path: root/src/modulemanager.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-06-20 21:33:01 -0400
committerAdam <Adam@anope.org>2010-06-20 21:33:01 -0400
commit17040c088a00a83094359382b9add202e3749db7 (patch)
treed4671d12949c363f3b81cd5bacce38b2c18f75c5 /src/modulemanager.cpp
parent0d2d7e996835c8c77c1eee5a4c90c3e2a60be4ff (diff)
Store modules in a list and xlines in a vector, not deques. We need to be able to keep iterators valid.
Diffstat (limited to 'src/modulemanager.cpp')
-rw-r--r--src/modulemanager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index 2d65ab4c9..878c041dd 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -87,7 +87,7 @@ static bool IsOneOfModuleTypeLoaded(MODType mt)
{
int pmods = 0;
- for (std::deque<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; ++it)
+ for (std::list<Module *>::const_iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; ++it)
{
if ((*it)->type == mt)
++pmods;
@@ -471,14 +471,12 @@ void ModuleManager::ClearCallBacks(Module *m)
*/
void ModuleManager::UnloadAll(bool unload_proto)
{
- for (std::deque<Module *>::iterator it = Modules.begin(), it_end = Modules.end(); it != it_end; )
+ 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 (Modules.empty())
- break;
}
}
+