From d1f211c5db3b402b5b5b79648c6d9703e725376a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 18 Apr 2011 15:46:12 +0200 Subject: [PATCH] Add UnloadEngine routine --- backend.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index fcc611a..07897c8 100644 --- a/backend.c +++ b/backend.c @@ -693,6 +693,24 @@ CommonEngineInit() } void +UnloadEngine(ChessProgramState *cps) +{ + /* Kill off first chess program */ + if (cps->isr != NULL) + RemoveInputSource(cps->isr); + cps->isr = NULL; + + if (cps->pr != NoProc) { + ExitAnalyzeMode(); + DoSleep( appData.delayBeforeQuit ); + SendToProgram("quit\n", cps); + DoSleep( appData.delayAfterQuit ); + DestroyChildProcess(cps->pr, cps->useSigterm); + } + cps->pr = NoProc; +} + +void ClearOptions(ChessProgramState *cps) { int i; -- 1.7.0.4