Fixed benchmark job object lifetime
This commit is contained in:
parent
d87ce78a64
commit
8709873fb1
1 changed files with 5 additions and 2 deletions
|
@ -25,6 +25,7 @@ namespace xmrig {
|
||||||
|
|
||||||
class Controller;
|
class Controller;
|
||||||
class Miner;
|
class Miner;
|
||||||
|
class Job;
|
||||||
|
|
||||||
class Benchmark : public IJobResultListener {
|
class Benchmark : public IJobResultListener {
|
||||||
|
|
||||||
|
@ -51,6 +52,7 @@ class Benchmark : public IJobResultListener {
|
||||||
Algorithm::CN_PICO_0,
|
Algorithm::CN_PICO_0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Job* m_bench_job[BenchAlgo::MAX];
|
||||||
float m_bench_algo_perf[BenchAlgo::MAX];
|
float m_bench_algo_perf[BenchAlgo::MAX];
|
||||||
|
|
||||||
Controller* m_controller; // to get access to config and network
|
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
|
void onJobResult(const JobResult&) override; // onJobResult is called after each computed benchmark hash
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Benchmark() : m_controller(nullptr), m_isNewBenchRun(true) {}
|
Benchmark();
|
||||||
|
virtual ~Benchmark();
|
||||||
|
|
||||||
void set_controller(Controller* controller) { m_controller = controller; }
|
void set_controller(Controller* controller) { m_controller = controller; }
|
||||||
virtual ~Benchmark() {}
|
|
||||||
|
|
||||||
void start(); // start benchmarks
|
void start(); // start benchmarks
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue