Fixed memory leak
This commit is contained in:
parent
541ecc4e4b
commit
1a819c6189
2 changed files with 12 additions and 0 deletions
|
@ -71,6 +71,17 @@ Hashrate::Hashrate(size_t threads, xmrig::Controller *controller) :
|
|||
}
|
||||
}
|
||||
|
||||
Hashrate::~Hashrate()
|
||||
{
|
||||
for (size_t i = 0; i < m_threads; i++) {
|
||||
delete [] m_counts[i];
|
||||
delete [] m_timestamps[i];
|
||||
}
|
||||
delete [] m_counts;
|
||||
delete [] m_timestamps;
|
||||
delete [] m_top;
|
||||
}
|
||||
|
||||
|
||||
double Hashrate::calc(size_t ms) const
|
||||
{
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
};
|
||||
|
||||
Hashrate(size_t threads, xmrig::Controller *controller);
|
||||
~Hashrate();
|
||||
double calc(size_t ms) const;
|
||||
double calc(size_t threadId, size_t ms) const;
|
||||
void add(size_t threadId, uint64_t count, uint64_t timestamp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue