mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-22 02:14:30 +00:00
Fixed coverity issue
This commit is contained in:
parent
3dde71f1ff
commit
948436e57e
1 changed files with 26 additions and 19 deletions
|
@ -2011,29 +2011,36 @@ void SideChain::finish_precalc()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
MutexLock lock(m_precalcJobsMutex);
|
{
|
||||||
for (PrecalcJob* job : m_precalcJobs) {
|
MutexLock lock(m_precalcJobsMutex);
|
||||||
delete job;
|
for (PrecalcJob* job : m_precalcJobs) {
|
||||||
|
delete job;
|
||||||
|
}
|
||||||
|
m_precalcJobs.clear();
|
||||||
|
m_precalcJobs.shrink_to_fit();
|
||||||
|
uv_cond_broadcast(&m_precalcJobsCond);
|
||||||
}
|
}
|
||||||
m_precalcJobs.clear();
|
|
||||||
m_precalcJobs.shrink_to_fit();
|
for (std::thread& t : m_precalcWorkers) {
|
||||||
uv_cond_broadcast(&m_precalcJobsCond);
|
t.join();
|
||||||
|
}
|
||||||
|
m_precalcWorkers.clear();
|
||||||
|
m_precalcWorkers.shrink_to_fit();
|
||||||
|
|
||||||
|
delete m_uniquePrecalcInputs;
|
||||||
|
m_uniquePrecalcInputs = nullptr;
|
||||||
|
|
||||||
|
uv_mutex_destroy(&m_precalcJobsMutex);
|
||||||
|
uv_cond_destroy(&m_precalcJobsCond);
|
||||||
|
|
||||||
|
LOGINFO(4, "pre-calculation workers stopped");
|
||||||
}
|
}
|
||||||
|
catch (const std::exception& e)
|
||||||
for (std::thread& t : m_precalcWorkers) {
|
{
|
||||||
t.join();
|
LOGERR(1, "exception in finish_precalc(): " << e.what());
|
||||||
}
|
}
|
||||||
m_precalcWorkers.clear();
|
|
||||||
m_precalcWorkers.shrink_to_fit();
|
|
||||||
|
|
||||||
delete m_uniquePrecalcInputs;
|
|
||||||
m_uniquePrecalcInputs = nullptr;
|
|
||||||
|
|
||||||
uv_mutex_destroy(&m_precalcJobsMutex);
|
|
||||||
uv_cond_destroy(&m_precalcJobsCond);
|
|
||||||
|
|
||||||
LOGINFO(4, "pre-calculation workers stopped");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace p2pool
|
} // namespace p2pool
|
||||||
|
|
Loading…
Reference in a new issue