From 8709873fb1bce0bbabc83b0106ab7544c260d604 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Tue, 30 Jul 2019 00:07:51 -0700 Subject: [PATCH] Fixed benchmark job object lifetime --- src/core/Benchmark.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Benchmark.h b/src/core/Benchmark.h index 41956e81..66949878 100644 --- a/src/core/Benchmark.h +++ b/src/core/Benchmark.h @@ -25,6 +25,7 @@ namespace xmrig { class Controller; class Miner; +class Job; class Benchmark : public IJobResultListener { @@ -51,6 +52,7 @@ class Benchmark : public IJobResultListener { Algorithm::CN_PICO_0, }; + Job* m_bench_job[BenchAlgo::MAX]; float m_bench_algo_perf[BenchAlgo::MAX]; Controller* m_controller; // to get access to config and network @@ -66,9 +68,10 @@ class Benchmark : public IJobResultListener { void onJobResult(const JobResult&) override; // onJobResult is called after each computed benchmark hash public: - Benchmark() : m_controller(nullptr), m_isNewBenchRun(true) {} + Benchmark(); + virtual ~Benchmark(); + void set_controller(Controller* controller) { m_controller = controller; } - virtual ~Benchmark() {} void start(); // start benchmarks