summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-24 12:10:59 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-24 12:10:59 +0200
commit53f72298692a4b76d49327c8d696c8c2927c2a68 (patch)
tree58bade665acc624803997eafcb1c28f828c4be2d
parent3a921efb0bd049eb8cccfcc205ebb260c78b423a (diff)
Change allocation of InspIRCd::Modes to be physically part of the object containing it using fakederef
-rw-r--r--include/inspircd.h2
-rw-r--r--include/mode.h2
-rw-r--r--src/inspircd.cpp4
-rw-r--r--src/mode.cpp2
4 files changed, 3 insertions, 7 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 4850d5a03..9d00454b4 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -346,7 +346,7 @@ class CoreExport InspIRCd
/** Mode handler, handles mode setting and removal
*/
- ModeParser* Modes;
+ ModeParser Modes;
/** Command parser, handles client to server commands
*/
diff --git a/include/mode.h b/include/mode.h
index 7c5682135..ffa5308f3 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -486,7 +486,7 @@ typedef std::multimap<std::string, ModeWatcher*>::iterator ModeWatchIter;
* parses client to server MODE strings for user and channel modes, and performs
* processing for the 004 mode list numeric, amongst other things.
*/
-class CoreExport ModeParser
+class CoreExport ModeParser : public fakederef<ModeParser>
{
public:
static const ModeHandler::Id MODEID_MAX = 64;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 6d072b0e5..8d0b8a649 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -125,7 +125,6 @@ void InspIRCd::Cleanup()
}
DeleteZero(this->FakeClient);
DeleteZero(this->Users);
- DeleteZero(this->Modes);
DeleteZero(this->XLines);
DeleteZero(this->Modules);
DeleteZero(this->SNO);
@@ -257,7 +256,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
this->SNO = 0;
this->Modules = 0;
this->XLines = 0;
- this->Modes = 0;
this->ConfigThread = NULL;
this->FakeClient = NULL;
@@ -397,8 +395,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
std::cout << "\tAttila" << con_reset << std::endl << std::endl;
std::cout << "Others:\t\t\t" << con_green << "See /INFO Output" << con_reset << std::endl;
- this->Modes = new ModeParser;
-
#ifndef _WIN32
if (!do_root)
this->CheckRoot();
diff --git a/src/mode.cpp b/src/mode.cpp
index 9d24160f6..3d2b8e5c4 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -35,7 +35,7 @@ ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modelett
CullResult ModeHandler::cull()
{
- if (ServerInstance->Modes)
+ if (ServerInstance)
ServerInstance->Modes->DelMode(this);
return classbase::cull();
}