summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-28 14:31:57 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-28 14:31:57 +0200
commit001e9c1372a1c6fc2877f9d6607cf662f09228df (patch)
tree3b026890c579fdd042e43a8d1eef0b7bbbea3973 /src/modules/m_spanningtree
parent5214968e7e0e0d43e137535ac1a9369c222d79f0 (diff)
m_spanningtree Remove split servers from the hash maps in TreeServer::SQuitInternal()
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp4
-rw-r--r--src/modules/m_spanningtree/treeserver.h8
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();