From 4cb8bc4dde304188560036b148c3cad849df0f3e Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 11 Oct 2018 15:44:25 +0200 Subject: [PATCH] Fixed hashrate race condition --- src/workers/Workers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 053c1477..3300bc66 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -215,6 +215,7 @@ void Workers::soft_stop() // stop current workers leaving uv stuff intact (used if (m_hashrate) { m_hashrate->stop(); delete m_hashrate; + m_hashrate = nullptr; } m_sequence = 0; @@ -387,6 +388,8 @@ void Workers::onResult(uv_async_t *handle) void Workers::onTick(uv_timer_t *handle) { + if (m_hashrate == nullptr) return; + for (Handle *handle : m_workers) { if (!handle->worker()) { return;