From 342b495cca013af4c504c847c6d4bf0c4fd73975 Mon Sep 17 00:00:00 2001 From: taynpg Date: Thu, 23 Oct 2025 11:43:49 +0800 Subject: [PATCH] fix: console client mem leak. --- Console/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Console/main.cpp b/Console/main.cpp index 9842eaf..0073fd1 100644 --- a/Console/main.cpp +++ b/Console/main.cpp @@ -1,7 +1,8 @@ #include #include -#include #include +#include +#include #include "Console.h" @@ -25,11 +26,11 @@ int main(int argc, char* argv[]) Util::InitLogger("frelayConsole.log", "frelayConsole"); qInstallMessageHandler(Util::ConsoleMsgHander); - auto* core = new ClientCore(); - auto* helper = new ConsoleHelper(); + auto core = std::make_shared(); + auto helper = std::make_shared(); helper->SetIpPort(argv[1], QString("%1").arg(argv[2]).toInt()); - helper->RunWorker(core); + helper->RunWorker(core.get()); helper->Connect(); return app.exec();