fix: console client mem leak.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <Util.h>
|
#include <Util.h>
|
||||||
#include <iostream>
|
|
||||||
#include <fversion.h>
|
#include <fversion.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
||||||
@@ -25,11 +26,11 @@ int main(int argc, char* argv[])
|
|||||||
Util::InitLogger("frelayConsole.log", "frelayConsole");
|
Util::InitLogger("frelayConsole.log", "frelayConsole");
|
||||||
qInstallMessageHandler(Util::ConsoleMsgHander);
|
qInstallMessageHandler(Util::ConsoleMsgHander);
|
||||||
|
|
||||||
auto* core = new ClientCore();
|
auto core = std::make_shared<ClientCore>();
|
||||||
auto* helper = new ConsoleHelper();
|
auto helper = std::make_shared<ConsoleHelper>();
|
||||||
|
|
||||||
helper->SetIpPort(argv[1], QString("%1").arg(argv[2]).toInt());
|
helper->SetIpPort(argv[1], QString("%1").arg(argv[2]).toInt());
|
||||||
helper->RunWorker(core);
|
helper->RunWorker(core.get());
|
||||||
helper->Connect();
|
helper->Connect();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|||||||
Reference in New Issue
Block a user