]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Be sure book file is closed before we leave
[stockfish] / src / search.cpp
index 22bfe8d6daa72bd80d63eae109e8f817da6ce7a6..64863be166b07f84f53571c10ee79e392f3d210d 100644 (file)
@@ -371,10 +371,8 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move,
   {
       Move bookMove;
       if (get_option_value_string("Book File") != OpeningBook.file_name())
   {
       Move bookMove;
       if (get_option_value_string("Book File") != OpeningBook.file_name())
-      {
-          OpeningBook.close();
           OpeningBook.open("book.bin");
           OpeningBook.open("book.bin");
-      }
+
       bookMove = OpeningBook.get_move(pos);
       if (bookMove != MOVE_NONE)
       {
       bookMove = OpeningBook.get_move(pos);
       if (bookMove != MOVE_NONE)
       {
@@ -545,7 +543,6 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move,
 
   if (Quit)
   {
 
   if (Quit)
   {
-      OpeningBook.close();
       stop_threads();
       quit_eval();
       exit(0);
       stop_threads();
       quit_eval();
       exit(0);
@@ -2561,7 +2558,6 @@ namespace {
         command = "quit";
 
       if(command == "quit") {
         command = "quit";
 
       if(command == "quit") {
-        OpeningBook.close();
         stop_threads();
         quit_eval();
         exit(0);
         stop_threads();
         quit_eval();
         exit(0);