From b071a6acd805bde6119a66481768be13102d1c2b Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 13 Jun 2014 15:09:20 +0200 Subject: [PATCH] Change allocation of InspIRCd::Threads to be physically part of the object containing it --- include/inspircd.h | 2 +- src/inspircd.cpp | 4 ---- src/modules/extra/m_ldap.cpp | 2 +- src/modules/extra/m_mssql.cpp | 2 +- src/modules/extra/m_mysql.cpp | 2 +- src/server.cpp | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/inspircd.h b/include/inspircd.h index 30625c42a..94b6cbafd 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -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 */ diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ff28be6c1..942ac55a6 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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; diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index d480a88f6..4666a86a2 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -557,7 +557,7 @@ class ModuleLDAP : public Module conns[id] = conn; ServerInstance->Modules->AddService(*conn); - ServerInstance->Threads->Start(conn); + ServerInstance->Threads.Start(conn); } else { diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 8f8fe080f..8fc605df9 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -655,7 +655,7 @@ class ModuleMsSQL : public Module { ReadConf(); - ServerInstance->Threads->Start(queryDispatcher); + ServerInstance->Threads.Start(queryDispatcher); } ~ModuleMsSQL() diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 3aed09416..fd1a83112 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -380,7 +380,7 @@ ModuleSQL::ModuleSQL() void ModuleSQL::init() { Dispatcher = new DispatcherThread(this); - ServerInstance->Threads->Start(Dispatcher); + ServerInstance->Threads.Start(Dispatcher); } ModuleSQL::~ModuleSQL() diff --git a/src/server.cpp b/src/server.cpp index ac638a08c..ab5369231 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -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); } } -- 2.39.5