diff --git a/src/App.cpp b/src/App.cpp index 53eab7c3..ed7bdc4c 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -87,9 +87,10 @@ int xmrig::App::exec() } m_controller->pre_start(); + m_controller->config()->benchmark().set_controller(m_controller); if (m_controller->config()->benchmark().isNewBenchRun() || m_controller->config()->isRebenchAlgo()) { - m_controller->config()->benchmark().start(m_controller); + m_controller->config()->benchmark().start(); } else { m_controller->start(); } diff --git a/src/core/Benchmark.cpp b/src/core/Benchmark.cpp index 27c38e26..f83546b6 100644 --- a/src/core/Benchmark.cpp +++ b/src/core/Benchmark.cpp @@ -30,8 +30,7 @@ namespace xmrig { // start performance measurements from the first bench_algo -void Benchmark::start(Controller* controller) { - m_controller = controller; +void Benchmark::start() { JobResults::setListener(this); // register benchmark as job result listener to compute hashrates there // write text before first benchmark round LOG_ALERT(">>>>> STARTING ALGO PERFORMANCE CALIBRATION (with %i seconds round)", m_controller->config()->benchAlgoTime()); diff --git a/src/core/Benchmark.h b/src/core/Benchmark.h index c91a4708..41956e81 100644 --- a/src/core/Benchmark.h +++ b/src/core/Benchmark.h @@ -67,9 +67,10 @@ class Benchmark : public IJobResultListener { public: Benchmark() : m_controller(nullptr), m_isNewBenchRun(true) {} + void set_controller(Controller* controller) { m_controller = controller; } virtual ~Benchmark() {} - void start(Controller* controller); // start benchmarks + void start(); // start benchmarks bool isNewBenchRun() const { return m_isNewBenchRun; } float algo_perf[Algorithm::MAX];