Added real graceful exit.
This commit is contained in:
parent
1e62943010
commit
ba68fb6c53
41 changed files with 391 additions and 303 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
Network *network() const;
|
||||
void addListener(IControllerListener *listener);
|
||||
void save();
|
||||
void stop();
|
||||
|
||||
protected:
|
||||
void onNewConfig(IConfig *config) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue