Release dataset om stop_mining

This commit is contained in:
Howard Chu 2019-06-09 10:56:49 +01:00
parent 8d22b01dca
commit d8bc1fe5c7
No known key found for this signature in database
GPG Key ID: FD2A70B44AB11BA7
2 changed files with 9 additions and 0 deletions

View File

@ -347,3 +347,10 @@ void rx_slow_hash_free_state(void) {
rx_vm = NULL;
}
}
void rx_stop_mining(void) {
if (rx_dataset != NULL) {
randomx_release_dataset(rx_dataset);
rx_dataset = NULL;
}
}

View File

@ -434,6 +434,7 @@ namespace cryptonote
{
boost::interprocess::ipcdetail::atomic_write32(&m_stop, 1);
}
extern "C" void rx_stop_mining(void);
//-----------------------------------------------------------------------------------------------------
bool miner::stop()
{
@ -466,6 +467,7 @@ namespace cryptonote
MINFO("Mining has been stopped, " << m_threads.size() << " finished" );
m_threads.clear();
m_threads_autodetect.clear();
rx_stop_mining();
return true;
}
//-----------------------------------------------------------------------------------------------------