mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-12 01:42:48 -05:00
Added real graceful exit.
This commit is contained in:
@@ -75,8 +75,6 @@ xmrig::Controller::Controller(Process *process)
|
||||
|
||||
xmrig::Controller::~Controller()
|
||||
{
|
||||
ConfigLoader::release();
|
||||
|
||||
delete d_ptr;
|
||||
}
|
||||
|
||||
@@ -109,11 +107,11 @@ int xmrig::Controller::init()
|
||||
Platform::setProcessPriority(d_ptr->config->priority());
|
||||
|
||||
if (!config()->isBackground()) {
|
||||
Log::add(new ConsoleLog(this));
|
||||
Log::add(new ConsoleLog());
|
||||
}
|
||||
|
||||
if (config()->logFile()) {
|
||||
Log::add(new FileLog(this, config()->logFile()));
|
||||
Log::add(new FileLog(config()->logFile()));
|
||||
}
|
||||
|
||||
# ifdef HAVE_SYSLOG_H
|
||||
@@ -166,3 +164,12 @@ void xmrig::Controller::onNewConfig(IConfig *config)
|
||||
|
||||
delete previousConfig;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Controller::stop()
|
||||
{
|
||||
ConfigLoader::release();
|
||||
|
||||
delete d_ptr->network;
|
||||
d_ptr->network = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user