mirror of
https://github.com/anope/anope.git
synced 2026-07-09 14:03:13 +02:00
Fix incorrect iteration when destructing modelockimpls
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user