diff options
author | Adam <Adam@anope.org> | 2015-07-13 18:02:44 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-07-13 18:02:44 -0400 |
commit | a86162f2877d6576b2a4accec00372f246629869 (patch) | |
tree | fe700264b04ef804b63775c65563e81707f466df /modules/commands/cs_mode.cpp | |
parent | ceddb8370c85f5c5319b497a9c4efb578338beed (diff) |
Fix incorrect iteration when destructing modelockimpls
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r-- | modules/commands/cs_mode.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index b11bc8862..e801b3959 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -44,10 +44,11 @@ struct ModeLocksImpl : ModeLocks ~ModeLocksImpl() { - for (ModeList::iterator it = this->mlocks->begin(); it != this->mlocks->end();) + ModeList modelist; + mlocks->swap(modelist); + for (ModeList::iterator it = modelist.begin(); it != modelist.end(); ++it) { ModeLock *ml = *it; - ++it; delete ml; } } |