summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/main.h2
-rw-r--r--src/modules/m_spanningtree/utils.cpp7
-rw-r--r--src/modules/m_spanningtree/utils.h2
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
*/