From c87482db9c30b0c3a007da40e0031462ee5f27c0 Mon Sep 17 00:00:00 2001 From: ComputeryPony <39446931+ComputeryPony@users.noreply.github.com> Date: Tue, 10 May 2022 00:56:06 -0500 Subject: [PATCH] Only kill p2pool if we started it --- src/p2pool/P2PoolManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/p2pool/P2PoolManager.cpp b/src/p2pool/P2PoolManager.cpp index ccfe4f94..7f9e2a4f 100644 --- a/src/p2pool/P2PoolManager.cpp +++ b/src/p2pool/P2PoolManager.cpp @@ -206,15 +206,17 @@ bool P2PoolManager::start(const QString &flags, const QString &address, const QS void P2PoolManager::exit() { qDebug("P2PoolManager: exit()"); + if (started) { #ifdef Q_OS_WIN QProcess::execute("taskkill", {"/F", "/IM", "p2pool.exe"}); #else QProcess::execute("pkill", {"p2pool"}); #endif - started = false; - QString dirName = QApplication::applicationDirPath() + "/stats/"; - QDir dir(dirName); - dir.removeRecursively(); + started = false; + QString dirName = QApplication::applicationDirPath() + "/stats/"; + QDir dir(dirName); + dir.removeRecursively(); + } } P2PoolManager::P2PoolManager(QObject *parent)