mirror of
https://github.com/anope/anope.git
synced 2026-07-06 20:43:12 +02:00
Also defer channel deletion when processing sjoins
This commit is contained in:
@@ -302,6 +302,8 @@ class CoreExport Channel : public Base, public Extensible
|
||||
*/
|
||||
static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime);
|
||||
|
||||
void QueueForDeletion();
|
||||
|
||||
static void DeleteChannels();
|
||||
};
|
||||
|
||||
|
||||
+7
-2
@@ -168,8 +168,7 @@ void Channel::DeleteUser(User *user)
|
||||
Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete non-existent channel " << this->name << " from " << user->nick << "'s channel list";
|
||||
delete cu;
|
||||
|
||||
if (std::find(deleting.begin(), deleting.end(), this) == deleting.end())
|
||||
deleting.push_back(this);
|
||||
QueueForDeletion();
|
||||
}
|
||||
|
||||
ChanUserContainer *Channel::FindUser(User *u) const
|
||||
@@ -938,6 +937,12 @@ Channel *Channel::FindOrCreate(const Anope::string &name, bool &created, time_t
|
||||
return chan;
|
||||
}
|
||||
|
||||
void Channel::QueueForDeletion()
|
||||
{
|
||||
if (std::find(deleting.begin(), deleting.end(), this) == deleting.end())
|
||||
deleting.push_back(this);
|
||||
}
|
||||
|
||||
void Channel::DeleteChannels()
|
||||
{
|
||||
for (unsigned int i = 0; i < deleting.size(); ++i)
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
|
||||
c->Sync();
|
||||
|
||||
if (c->CheckDelete())
|
||||
delete c;
|
||||
c->QueueForDeletion();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user