]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Remove split servers from the hash maps in TreeServer::SQuitInternal()
authorAttila Molnar <attilamolnar@hush.com>
Mon, 28 Jul 2014 12:31:57 +0000 (14:31 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Mon, 28 Jul 2014 12:31:57 +0000 (14:31 +0200)
src/modules/m_spanningtree/treeserver.cpp
src/modules/m_spanningtree/treeserver.h

index f493f6d2001e21eba80f7b2d49022823019e2bd4..5a2d4f8861b74757bdf990b163179beabb770e49 100644 (file)
@@ -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());
 }
index 2e6c47bf4be066f39a60ab8693e3b58a7ec40584..88b43d1820b54d55d5da71ee2f3d19b805ced0af 100644 (file)
@@ -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();