Skip to content

Commit

Permalink
fix segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
psychocrypt committed Oct 10, 2018
1 parent b772eed commit bbb5b0e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions xmrstak/misc/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1008,21 +1008,28 @@ void executor::shutdown()
{
bQuit = true;
std::cout<<"Shutdown miner, this takes up to 15 sec ..."<<std::endl;
// notify all backend threads
for(auto& backend : *pvThreads)
backend->shutdown();

if(pvThreads != nullptr)
{
// notify all backend threads
for(auto& backend : *pvThreads)
backend->shutdown();
}

bool canClose = true;
size_t round = 0u;
do
{
canClose = true;
for(auto& backend : *pvThreads)
if(pvThreads != nullptr)
{
if(!backend->isShutdownFinished())
for(auto& backend : *pvThreads)
{
canClose = false;
break;
if(!backend->isShutdownFinished())
{
canClose = false;
break;
}
}
}

Expand Down

0 comments on commit bbb5b0e

Please sign in to comment.