mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-11 11:39:02 -04:00
Don't try and delete from the item list whilst iterating it - make a copy instead
All modules using u_listmode.h are now unloadable (thats 3 more down) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5105 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
2b96ff2ed9
commit
2208edf6ff
@ -107,7 +107,13 @@ class ListModeBase : public ModeHandler
|
||||
char moderemove[MAXBUF];
|
||||
userrec* n = new userrec(ServerInstance);
|
||||
n->SetFd(FD_MAGIC_NUMBER);
|
||||
modelist copy;
|
||||
/* Make a copy of it, because we cant change the list whilst iterating over it */
|
||||
for(modelist::iterator it = el->begin(); it != el->end(); it++)
|
||||
{
|
||||
copy.push_back(*it);
|
||||
}
|
||||
for(modelist::iterator it = copy.begin(); it != copy.end(); it++)
|
||||
{
|
||||
ServerInstance->Log(DEBUG,"Remove item %s",it->mask.c_str());
|
||||
sprintf(moderemove,"-%c",this->GetModeChar());
|
||||
|
Loading…
x
Reference in New Issue
Block a user