Browse Source

Avoid crash on Client delete.

cl-refactor
Gav Wood 11 years ago
parent
commit
9efb073fd1
  1. 9
      libethereum/Client.cpp

9
libethereum/Client.cpp

@ -100,6 +100,15 @@ void Client::ensureWorking()
Client::~Client()
{
if (m_work)
{
if (m_workState.load(std::memory_order_acquire) == Active)
m_workState.store(Deleting, std::memory_order_release);
while (m_workState.load(std::memory_order_acquire) != Deleted)
this_thread::sleep_for(chrono::milliseconds(10));
m_work->join();
m_work.reset(nullptr);
}
stopNetwork();
}

Loading…
Cancel
Save