Use unique_ptr for InspIRCd::ConfigThread.

This commit is contained in:
Sadie Powell 2024-09-19 13:13:04 +01:00
parent 2ab1281c4d
commit 566d438348
3 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ public:
std::unique_ptr<ServerConfig> Config;
/* If non-nullptr then the thread that is reading the server configuration on rehash. */
ConfigReaderThread* ConfigThread = nullptr;
std::unique_ptr<ConfigReaderThread> ConfigThread;
/** A fake user that represents the local server. */
FakeUser* FakeClient = nullptr;

View File

@ -629,7 +629,7 @@ void InspIRCd::Run()
/* Rehash has completed */
this->Logs.Normal("CONFIG", "New configuration has been read, applying...");
ConfigThread->Stop();
stdalgo::delete_zero(ConfigThread);
ConfigThread.reset(nullptr);
}
UpdateTime();

View File

@ -62,7 +62,7 @@ void InspIRCd::Rehash(const std::string& uuid)
{
if (!ConfigThread)
{
ConfigThread = new ConfigReaderThread(uuid);
ConfigThread = std::make_unique<ConfigReaderThread>(uuid);
ConfigThread->Start();
}
}