From: H.G. Muller Date: Mon, 18 Apr 2011 13:46:12 +0000 (+0200) Subject: Add UnloadEngine routine X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d1f211c5db3b402b5b5b79648c6d9703e725376a;p=xboard.git Add UnloadEngine routine --- 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;