diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index f493f6d20..5a2d4f886 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -213,6 +213,7 @@ void TreeServer::SQuitInternal(const std::string& reason, int& num_lost_servers, num_lost_servers++; num_lost_users += QuitUsers(reason); + RemoveHash(); } int TreeServer::QuitUsers(const std::string &reason) @@ -362,7 +363,10 @@ TreeServer::~TreeServer() /* We'd better tidy up after ourselves, eh? */ if (!IsRoot()) delete ServerUser; +} +void TreeServer::RemoveHash() +{ Utils->sidlist.erase(sid); Utils->serverlist.erase(GetName()); } diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 2e6c47bf4..88b43d182 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -69,6 +69,10 @@ class TreeServer : public Server */ void SQuitInternal(const std::string& reason, int& num_lost_servers, int& num_lost_users); + /** Remove the reference to this server from the hash maps + */ + void RemoveHash(); + public: typedef std::vector<TreeServer*> ChildServers; FakeUser* const ServerUser; /* User representing this server */ @@ -237,9 +241,7 @@ class TreeServer : public Server CullResult cull(); - /** Destructor - * Removes the reference to this object from the - * hash maps. + /** Destructor, deletes ServerUser unless IsRoot() */ ~TreeServer(); |