Merge pull request 'XMRig: fix stop on windows' (#102) from tobtoht/feather:xmrrig_stop_windows into master

Reviewed-on: https://git.wownero.com/feather/feather/pulls/102
This commit is contained in:
tobtoht 2020-10-21 10:37:32 +00:00
commit 7441d6cb4a
3 changed files with 7 additions and 8 deletions

View file

@ -32,13 +32,13 @@ void XmRig::prepare() {
}
void XmRig::stop() {
if(m_process.state() == QProcess::Running)
m_process.kill();
}
void XmRig::terminate() {
if(m_process.state() == QProcess::Running)
if(m_process.state() == QProcess::Running) {
#if defined(Q_OS_WIN)
m_process.kill(); // https://doc.qt.io/qt-5/qprocess.html#terminate
#else
m_process.terminate();
#endif
}
}
void XmRig::start(const QString &path,

View file

@ -25,7 +25,6 @@ public:
void start(const QString &path, unsigned int threads, const QString &address, const QString &username, const QString &password, bool tor = false, bool tls = true);
void stop();
void terminate();
bool unpackBins();
QString rigDir;

View file

@ -185,7 +185,7 @@ void XMRigWidget::onStartClicked() {
}
void XMRigWidget::onStopClicked() {
m_ctx->XMRig->terminate();
m_ctx->XMRig->stop();
ui->btn_start->setEnabled(true);
ui->btn_stop->setEnabled(false);
ui->label_status->hide();