Make CCheckQueue destructor stop worker threads

This commit is contained in:
Hennadii Stepanov 2023-07-07 10:37:36 +01:00
parent be4ff3060b
commit d03eaacbcf
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
9 changed files with 2 additions and 29 deletions

View file

@ -268,10 +268,9 @@ void Shutdown(NodeContext& node)
StopTorControl();
// After everything has been shut down, but before things get flushed, stop the
// CScheduler/checkqueue, scheduler and load block thread.
// scheduler and load block thread.
if (node.scheduler) node.scheduler->stop();
if (node.chainman && node.chainman->m_thread_load.joinable()) node.chainman->m_thread_load.join();
if (node.chainman) node.chainman->StopScriptCheckWorkerThreads();
// After the threads that potentially access these pointers have been stopped,
// destruct and reset all to nullptr.