]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change allocation of InspIRCd::Threads to be physically part of the object containing it
authorAttila Molnar <attilamolnar@hush.com>
Fri, 13 Jun 2014 13:09:20 +0000 (15:09 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 13 Jun 2014 13:09:20 +0000 (15:09 +0200)
include/inspircd.h
src/inspircd.cpp
src/modules/extra/m_ldap.cpp
src/modules/extra/m_mssql.cpp
src/modules/extra/m_mysql.cpp
src/server.cpp

index 30625c42a1513b0627ef6fb7c5c503781f3fbd42..94b6cbafd47522889566c0d0de2d487485efc991 100644 (file)
@@ -346,7 +346,7 @@ class CoreExport InspIRCd
 
        /** Thread engine, Handles threading where required
         */
-       ThreadEngine* Threads;
+       ThreadEngine Threads;
 
        /** The thread/class used to read config files in REHASH and on startup
         */
index ff28be6c1a36fe34a19c2e3cfa19061b4f18d05a..942ac55a6e05553edf63d51ea622e5379bdc74e7 100644 (file)
@@ -138,7 +138,6 @@ void InspIRCd::Cleanup()
        DeleteZero(this->SNO);
        DeleteZero(this->Config);
        DeleteZero(this->PI);
-       DeleteZero(this->Threads);
        SocketEngine::Deinit();
        Logs->CloseLogs();
        DeleteZero(this->Logs);
@@ -260,7 +259,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
 
        // Initialize so that if we exit before proper initialization they're not deleted
        this->Logs = 0;
-       this->Threads = 0;
        this->PI = 0;
        this->Users = 0;
        this->Config = 0;
@@ -281,8 +279,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
 
        SocketEngine::Init();
 
-       this->Threads = new ThreadEngine;
-
        /* Default implementation does nothing */
        this->PI = new ProtocolInterface;
 
index d480a88f61838cc73ce7916cbb2ba677795b2864..4666a86a2804bad837b7e21532d7401dca77bc22 100644 (file)
@@ -557,7 +557,7 @@ class ModuleLDAP : public Module
                                conns[id] = conn;
 
                                ServerInstance->Modules->AddService(*conn);
-                               ServerInstance->Threads->Start(conn);
+                               ServerInstance->Threads.Start(conn);
                        }
                        else
                        {
index 8f8fe080fbd2c99483c56e8b4bebacf59e6b928e..8fc605df952467c7ff83582cabd55e17b6f5e86d 100644 (file)
@@ -655,7 +655,7 @@ class ModuleMsSQL : public Module
        {
                ReadConf();
 
-               ServerInstance->Threads->Start(queryDispatcher);
+               ServerInstance->Threads.Start(queryDispatcher);
        }
 
        ~ModuleMsSQL()
index 3aed094164321b7dcdde6be982fc041bfb9411f8..fd1a8311279ba1d7250d468d98994e6aeb8d069e 100644 (file)
@@ -380,7 +380,7 @@ ModuleSQL::ModuleSQL()
 void ModuleSQL::init()
 {
        Dispatcher = new DispatcherThread(this);
-       ServerInstance->Threads->Start(Dispatcher);
+       ServerInstance->Threads.Start(Dispatcher);
 }
 
 ModuleSQL::~ModuleSQL()
index ac638a08c17ca42771b23b10fbf67645ecdf965c..ab53692315dd33f8325738ce10001d9c6c16289e 100644 (file)
@@ -61,7 +61,7 @@ void InspIRCd::Rehash(const std::string& uuid)
        if (!ServerInstance->ConfigThread)
        {
                ServerInstance->ConfigThread = new ConfigReaderThread(uuid);
-               ServerInstance->Threads->Start(ServerInstance->ConfigThread);
+               ServerInstance->Threads.Start(ServerInstance->ConfigThread);
        }
 }