From 3400b094ef19fc8fc1eae6d12fb33667cd5629b9 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 21 Sep 2009 18:42:47 +0000 Subject: 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 --- src/cull_list.cpp | 5 +++-- src/usermanager.cpp | 2 +- src/users.cpp | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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::iterator i = list.begin(); i != list.end(); i++) + std::vector todel(list.begin(), list.end()); + list.clear(); + for(std::vector::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) { -- cgit v1.2.3