From: Marco Costalba Date: Mon, 26 Mar 2012 17:35:23 +0000 (+0100) Subject: Call wait_for_search_finished() only when quitting X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d11a52990459601e46e02a8759616737dc045f74 Call wait_for_search_finished() only when quitting When quitting we should avoid RootPosition to be destroyed while threads are still running, leading to a crash. In case of a "stop" or "ponderhit" command there is no need for the UI thread to wait. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/uci.cpp b/src/uci.cpp index 987da9c1..0057881b 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -69,7 +69,9 @@ void uci_loop() { if (token == "quit" || token == "stop") { Search::Signals.stop = true; - Threads.wait_for_search_finished(); // Cannot quit while threads are running + + if (token == "quit") // Cannot quit while threads are still running + Threads.wait_for_search_finished(); } else if (token == "ponderhit") @@ -80,10 +82,7 @@ void uci_loop() { Search::Limits.ponder = false; if (Search::Signals.stopOnPonderhit) - { Search::Signals.stop = true; - Threads.wait_for_search_finished(); - } } else if (token == "go")