X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=b7bead9ff0c867627105cb0eb8ee9ffa328c733e;hp=782cf1acc0dd5153fb8ba3bebad8cf69bc35da12;hb=2a98042c21fa2f3f5630c41a16b91539d7da3b87;hpb=46409a7852ae22abf9c32cbcfe3b35f164ae8ec5 diff --git a/src/thread.cpp b/src/thread.cpp index 782cf1ac..b7bead9f 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -366,10 +366,14 @@ void ThreadPool::start_thinking(const Position& pos, const LimitsType& limits, Signals.stopOnPonderhit = Signals.firstRootMove = false; Signals.stop = Signals.failedLowAtRoot = false; + RootMoves.clear(); RootPos = pos; Limits = limits; - SetupStates = states; // Ownership transfer here - RootMoves.clear(); + if (states.get()) // If we don't set a new position, preserve current state + { + SetupStates = states; // Ownership transfer here + assert(!states.get()); + } for (MoveList it(pos); *it; ++it) if ( searchMoves.empty()