X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=948538ff460d15162048800ceea8c77a218f5954;hb=8ff409cb9a393559ebda3990ab2926c9a42d87a1;hp=fdf0f76e1abdbb4f20539b63749cda5546d3cfb6;hpb=47dda4f61512f6047f2b1dcccd1943aab74726e3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index fdf0f76e1..948538ff4 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -86,14 +86,13 @@ void Channel::CheckDestroy() if (res == MOD_RES_DENY) return; + // If the channel isn't in chanlist then it is already in the cull list, don't add it again chan_hash::iterator iter = ServerInstance->chanlist.find(this->name); - /* kill the record */ - if (iter != ServerInstance->chanlist.end()) - { - FOREACH_MOD(OnChannelDelete, (this)); - ServerInstance->chanlist.erase(iter); - } + if ((iter == ServerInstance->chanlist.end()) || (iter->second != this)) + return; + FOREACH_MOD(OnChannelDelete, (this)); + ServerInstance->chanlist.erase(iter); ClearInvites(); ServerInstance->GlobalCulls.AddItem(this); }