diff --git a/src/init.cpp b/src/init.cpp index 78f838f7..6777f48d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -123,13 +123,15 @@ void Shutdown() // void DetectShutdownThread(boost::thread_group* threadGroup) { + bool shutdown = ShutdownRequested(); // Tell the main threads to shutdown. - while (!fRequestShutdown) + while (!shutdown) { MilliSleep(200); - if (fRequestShutdown) - threadGroup->interrupt_all(); + shutdown = ShutdownRequested(); } + if (threadGroup) + threadGroup->interrupt_all(); } void HandleSIGTERM(int)