Skip to content

Commit

Permalink
Release dataset om stop_mining
Browse files Browse the repository at this point in the history
  • Loading branch information
hyc committed Jun 9, 2019
1 parent 8d22b01 commit d8bc1fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/crypto/rx-slow-hash.c
Expand Up @@ -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;
}
}
2 changes: 2 additions & 0 deletions src/cryptonote_basic/miner.cpp
Expand Up @@ -434,6 +434,7 @@ namespace cryptonote
{
boost::interprocess::ipcdetail::atomic_write32(&m_stop, 1);
}
extern "C" void rx_stop_mining(void);
//-----------------------------------------------------------------------------------------------------
bool miner::stop()
{
Expand Down Expand Up @@ -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;
}
//-----------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit d8bc1fe

Please sign in to comment.