diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-29 09:35:46 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-29 09:35:46 +0000 |
commit | 0d0755d91d97c08bf0f2ade1ae64d7f1aacc9723 (patch) | |
tree | 1e07e02ab261f1b9318864c98cec2e8ec6e80b27 /src/modules/m_spanningtree.cpp | |
parent | 30167f06a824204e2bdf2bd6332b42fb1a8738fb (diff) |
Recursive free sucks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1989 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index a6db47bf5..33b72dd1a 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -68,7 +68,6 @@ class TreeServer int UserCount; int OperCount; TreeSocket* Socket; // for directly connected servers this points at the socket object - bool Deleted; public: @@ -79,7 +78,6 @@ class TreeServer ServerDesc = ""; VersionString = ""; UserCount = OperCount = 0; - Deleted = false; } TreeServer(std::string Name, std::string Desc) : ServerName(Name), ServerDesc(Desc) @@ -87,14 +85,12 @@ class TreeServer Parent = NULL; VersionString = ""; UserCount = OperCount = 0; - Deleted = false; } TreeServer(std::string Name, std::string Desc, TreeServer* Above, TreeSocket* Sock) : Parent(Above), ServerName(Name), ServerDesc(Desc), Socket(Sock) { VersionString = ""; UserCount = OperCount = 0; - Deleted = false; } std::string GetName() @@ -149,11 +145,6 @@ class TreeServer } } - void MarkDeleted() - { - this->Deleted = true; - } - void AddChild(TreeServer* Child) { Children.push_back(Child); @@ -181,14 +172,15 @@ class TreeServer stillchildren = false; for (std::vector<TreeServer*>::iterator a = Children.begin(); a < Children.end(); a++) { - TreeServer*a = (TreeServer*)*a; - a->Tidy(); + TreeServer* s = (TreeServer*)*a; + s->Tidy(); Children.erase(a); - delete a; + delete s; stillchildren = true; break; } } + return true; } }; @@ -388,8 +380,7 @@ class TreeSocket : public InspSocket this->SquitServer(recursive_server); } // Now we've whacked the kids, whack self - this->MarkDeleted(); - log(DEBUG,"Deleted %s",Current->GetName()); + log(DEBUG,"Deleted %s",Current->GetName().c_str()); bool quittingpeople = true; while (quittingpeople) { @@ -398,7 +389,8 @@ class TreeSocket : public InspSocket { if (!strcasecmp(u->second->server,Current->GetName().c_str())) { - Srv->QuitUser(u,Current->GetName()+" "+std::string(Srv->GetServerName())); + log(DEBUG,"Quitting user %s of server %s",u->second->nick,u->second->server); + Srv->QuitUser(u->second,Current->GetName()+" "+std::string(Srv->GetServerName())); quittingpeople = true; break; } |