From 9a01dd57fdf18f641f3cf7f68a3027e022eb1571 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 10 Jun 2015 10:19:09 +0900 Subject: [PATCH] Avoid miner crashes. --- libethcore/Ethash.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index f715d6912..f4a8c25c4 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -340,6 +340,7 @@ void Ethash::GPUMiner::workLoop() if (shouldStop()) { delete m_miner; + m_miner = nullptr; return; } cnote << "Awaiting DAG"; @@ -354,6 +355,8 @@ void Ethash::GPUMiner::workLoop() } catch (cl::Error const& _e) { + delete m_miner; + m_miner = nullptr; cwarn << "Error GPU mining: " << _e.what() << "(" << _e.err() << ")"; } }