diff --git a/src/init.cpp b/src/init.cpp index c90437422..78205c168 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -214,10 +214,13 @@ void Shutdown() StopTorControl(); - // After everything has been shut down, but before things get flushed, stop the - // CScheduler/checkqueue, scheduler and load block thread. + // After everything has been shut down, but before things get flushed, + //1. stop the checkqueue threads. StopScriptCheckWorkerThreads(); + //2. stop scheduler and load block threads. + scheduler.stop(); + // After the threads that potentially access these pointers have been stopped, // destruct and reset all to nullptr. peerLogic.reset();