Browse Source

fixed potential race condition on DownloadMan destruction

cl-refactor
arkpar 10 years ago
parent
commit
b796e7238c
  1. 1
      libethereum/DownloadMan.cpp
  2. 3
      libethereum/DownloadMan.h

1
libethereum/DownloadMan.cpp

@ -44,6 +44,7 @@ DownloadSub::DownloadSub(DownloadMan& _man): m_man(&_man)
DownloadSub::~DownloadSub()
{
Guard fl(m_fetch);
if (m_man)
{
WriteGuard l(m_man->x_subs);

3
libethereum/DownloadMan.h

@ -93,7 +93,10 @@ public:
~DownloadMan()
{
for (auto i: m_subs)
{
Guard l(i->m_fetch);
i->m_man = nullptr;
}
}
void appendToChain(h256s const& _hashes)

Loading…
Cancel
Save