]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change allocation of InspIRCd::Modes to be physically part of the object containing...
authorAttila Molnar <attilamolnar@hush.com>
Tue, 24 Jun 2014 10:10:59 +0000 (12:10 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Tue, 24 Jun 2014 10:10:59 +0000 (12:10 +0200)
include/inspircd.h
include/mode.h
src/inspircd.cpp
src/mode.cpp

index 4850d5a0347febb02c17e0b83c05d5b6adb47bdd..9d00454b4c896a38ed9d22111372db37b015639f 100644 (file)
@@ -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
         */
index 7c5682135c7475f3d09353dbe0b734ac0230e8f2..ffa5308f33250ee9ad485238e4a737b5a777ebc5 100644 (file)
@@ -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;
index 6d072b0e547ef613bd0326e29dfab80befdb7253..8d0b8a6499014a747366807b490479ae2d30aa1b 100644 (file)
@@ -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();
index 9d24160f65b0bd8a2ba68c33138533aec83301ac..3d2b8e5c4bb83c78ba2f774be21de0502134a2b1 100644 (file)
@@ -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();
 }