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/treesocket1.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 7b233169d..c9729cc0f 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -212,8 +212,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason)
Current->Tidy();
Current->GetParent()->DelChild(Current);
Current->cull();
+ const bool ismyroot = (Current == MyRoot);
delete Current;
- if (Current == MyRoot)
+ if (ismyroot)
{
MyRoot = NULL;
Close();