]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Terminate threads before to exit main()
[stockfish] / src / thread.cpp
index 541610a1ca4b2bd5a63d16323c4d2aed991aae21..50412468ebb83222caf15a8b4b9835f018b7aa63 100644 (file)
@@ -196,9 +196,9 @@ void ThreadPool::init() {
 }
 
 
-// d'tor cleanly terminates the threads when the program exits.
+// exit() cleanly terminates the threads before the program exits.
 
-ThreadPool::~ThreadPool() {
+void ThreadPool::exit() {
 
   for (size_t i = 0; i < threads.size(); i++)
       delete threads[i];