summaryrefslogtreecommitdiff
path: root/src/common/Logging/Log.cpp
diff options
context:
space:
mode:
authorFrancesco Borzì <borzifrancesco@gmail.com>2025-07-19 11:36:40 +0200
committerGitHub <noreply@github.com>2025-07-19 11:36:40 +0200
commitc6a53849c70ef8e0c3c5b16c84ee1ef57b035eed (patch)
tree024e6ca896e8b46d16d2a587458ff4de8a1f3900 /src/common/Logging/Log.cpp
parentcbd8596184f2bf32edc5a83643ec3ef7e13982df (diff)
refactor(Core/Misc): string handling and use smart pointer for strand (#22351)
Diffstat (limited to 'src/common/Logging/Log.cpp')
-rw-r--r--src/common/Logging/Log.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 37809458b8..2b473a8731 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -29,6 +29,7 @@
#include "Timer.h"
#include "Tokenize.h"
#include <chrono>
+#include <memory>
Log::Log() : AppenderId(0), highestLogLevel(LOG_LEVEL_FATAL)
{
@@ -39,7 +40,6 @@ Log::Log() : AppenderId(0), highestLogLevel(LOG_LEVEL_FATAL)
Log::~Log()
{
- delete _strand;
Close();
}
@@ -369,7 +369,7 @@ void Log::Initialize(Acore::Asio::IoContext* ioContext)
if (ioContext)
{
_ioContext = ioContext;
- _strand = new Acore::Asio::Strand(*ioContext);
+ _strand = std::make_unique<Acore::Asio::Strand>(*ioContext);
}
LoadFromConfig();
@@ -377,8 +377,7 @@ void Log::Initialize(Acore::Asio::IoContext* ioContext)
void Log::SetSynchronous()
{
- delete _strand;
- _strand = nullptr;
+ _strand.reset();
_ioContext = nullptr;
}