mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
Chess: Send a quit command to ChessEngine when it is no longer in use
The chess GUI now instructs the ChessEngine to gracefully exit by sending a UCI quit command.
This commit is contained in:
parent
c2b9376409
commit
bf320e4826
2 changed files with 8 additions and 3 deletions
|
@ -13,8 +13,7 @@
|
|||
|
||||
Engine::~Engine()
|
||||
{
|
||||
if (m_pid != -1)
|
||||
kill(m_pid, SIGINT);
|
||||
quit();
|
||||
}
|
||||
|
||||
Engine::Engine(StringView command)
|
||||
|
@ -66,3 +65,8 @@ void Engine::handle_bestmove(Chess::UCI::BestMoveCommand const& command)
|
|||
|
||||
m_bestmove_callback = nullptr;
|
||||
}
|
||||
|
||||
void Engine::quit()
|
||||
{
|
||||
send_command(Chess::UCI::QuitCommand());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue