Terminate threads before to exit main()
[stockfish] / src / main.cpp
index ad68ca35fe47113ba8d6ad31937a4bc7dc1ce0ef..e4ebcc30140d5550c9b216d15da2a1833ecdb661 100644 (file)
@@ -37,8 +37,8 @@ int main(int argc, char* argv[]) {
   Zobrist::init();
   Bitbases::init_kpk();
   Search::init();
-  Threads.init();
   Eval::init();
+  Threads.init();
   TT.set_size(Options["Hash"]);
 
   std::string args;
@@ -47,4 +47,6 @@ int main(int argc, char* argv[]) {
       args += std::string(argv[i]) + " ";
 
   UCI::loop(args);
+
+  Threads.exit();
 }