diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 21:55:21 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-30 21:55:21 +0000 |
commit | 3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d (patch) | |
tree | 431e66fceef85d577d360865b3b878dc9132afc2 /src/modules | |
parent | 7aa5e059a8f66d91bd8b69c58c657ceb70b4baff (diff) |
Add explicit reference-counting base class
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11785 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.h | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index db40c7f6a..501baa290 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -939,9 +939,9 @@ void ModuleSpanningTree::OnEvent(Event* event) } } -void ModuleSpanningTree::cull() +bool ModuleSpanningTree::cull() { - Utils->cull(); + return Utils->cull(); } ModuleSpanningTree::~ModuleSpanningTree() diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 6e3f62056..429c0d4bd 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -191,7 +191,7 @@ class ModuleSpanningTree : public Module void OnEvent(Event* event); void OnLoadModule(Module* mod,const std::string &name); void OnUnloadModule(Module* mod,const std::string &name); - void cull(); + bool cull(); ~ModuleSpanningTree(); Version GetVersion(); void Prioritize(); diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index fc5356c66..6f94ead60 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -157,7 +157,7 @@ SpanningTreeUtilities::SpanningTreeUtilities(ModuleSpanningTree* C) : Creator(C) this->ReadConfiguration(true); } -void SpanningTreeUtilities::cull() +bool SpanningTreeUtilities::cull() { for (unsigned int i = 0; i < Bindings.size(); i++) { @@ -175,7 +175,9 @@ void SpanningTreeUtilities::cull() } ServerUser->uuid = TreeRoot->GetID(); - ServerUser->cull(); + if (ServerUser->cull()) + delete ServerUser; + return true; } SpanningTreeUtilities::~SpanningTreeUtilities() @@ -186,7 +188,6 @@ SpanningTreeUtilities::~SpanningTreeUtilities() } delete TreeRoot; - delete ServerUser; } void SpanningTreeUtilities::AddThisServer(TreeServer* server, TreeServerList &list) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 1de6de076..d1922ed75 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -166,7 +166,7 @@ class SpanningTreeUtilities : public classbase /** Prepare for class destruction */ - void cull(); + bool cull(); /** Destroy class and free listeners etc */ |