summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-13 15:57:14 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-13 15:57:14 +0200
commit6193243e4b9234ba663bb9f0378490ae0e972826 (patch)
treedd6fc6157fee51100effe4b5dc7f2b73dbf57c67 /src/modules/m_spanningtree
parent5b1ee304b5e1d71c71eec9ebf8f40758dfce5c1e (diff)
m_spanningtree Change allocation of the specialized ProtocolInterface to be physically part of ModuleSpanningTree
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/main.h5
-rw-r--r--src/modules/m_spanningtree/netburst.cpp1
3 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 45f219286..8f0586923 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -33,7 +33,6 @@
#include "link.h"
#include "treesocket.h"
#include "commands.h"
-#include "protocolinterface.h"
ModuleSpanningTree::ModuleSpanningTree()
: rconnect(this), rsquit(this), map(this)
@@ -88,7 +87,7 @@ void ModuleSpanningTree::init()
commands = new SpanningTreeCommands(this);
delete ServerInstance->PI;
- ServerInstance->PI = new SpanningTreeProtocolInterface;
+ ServerInstance->PI = &protocolinterface;
delete ServerInstance->FakeClient->server;
SetLocalUsersServer(Utils->TreeRoot);
@@ -759,7 +758,6 @@ CullResult ModuleSpanningTree::cull()
ModuleSpanningTree::~ModuleSpanningTree()
{
- delete ServerInstance->PI;
ServerInstance->PI = new ProtocolInterface;
Server* newsrv = new Server(ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc);
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 7fb2c6701..da94cb877 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -27,6 +27,7 @@
#include "modules/dns.h"
#include "servercommand.h"
#include "commands.h"
+#include "protocolinterface.h"
/** If you make a change which breaks the protocol, increment this.
* If you completely change the protocol, completely change the number.
@@ -67,6 +68,10 @@ class ModuleSpanningTree : public Module
*/
Membership::Id currmembid;
+ /** The specialized ProtocolInterface that is assigned to ServerInstance->PI on load
+ */
+ SpanningTreeProtocolInterface protocolinterface;
+
public:
dynamic_reference<DNS::Manager> DNS;
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 093ab89eb..2703ad0f0 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -27,7 +27,6 @@
#include "treeserver.h"
#include "main.h"
#include "commands.h"
-#include "protocolinterface.h"
/**
* Creates FMODE messages, used only when syncing channels