summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 18:42:47 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 18:42:47 +0000
commit3400b094ef19fc8fc1eae6d12fb33667cd5629b9 (patch)
treebbb61ba9c372e60c7ca3287c7710b524ec8b471b
parent4f6589e123c0a494287f59e3bc75e34ed6e4f6d7 (diff)
Allow objects to be added to cull list during apply - fixes user deletion on netsplit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11754 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cull_list.cpp5
-rw-r--r--src/usermanager.cpp2
-rw-r--r--src/users.cpp1
3 files changed, 5 insertions, 3 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp
index 35fa44bfa..c45dff46c 100644
--- a/src/cull_list.cpp
+++ b/src/cull_list.cpp
@@ -18,12 +18,13 @@
void CullList::Apply()
{
- for(std::set<classbase*>::iterator i = list.begin(); i != list.end(); i++)
+ std::vector<classbase*> todel(list.begin(), list.end());
+ list.clear();
+ for(std::vector<classbase*>::iterator i = todel.begin(); i != todel.end(); i++)
{
classbase* c = *i;
c->cull();
delete c;
}
- list.clear();
}
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 6d04bdff7..15196ac69 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -179,7 +179,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
user->quitting = true;
- ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str());
+ ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s=%s '%s'", user->uuid.c_str(), user->nick.c_str(), quitreason.c_str());
user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str());
std::string reason;
diff --git a/src/users.cpp b/src/users.cpp
index 5d6b1a01a..b63350386 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -235,6 +235,7 @@ User::User(InspIRCd* Instance, const std::string &uid)
User::~User()
{
+ ServerInstance->Logs->Log("USERS", DEBUG, "User destructor for %s", uuid.c_str());
/* NULL for remote users :) */
if (this->MyClass)
{