More thorough switch to -ncp on engine failure
authorH.G. Muller <h.g.muller@hccnet.nl>
Tue, 13 Mar 2012 20:46:55 +0000 (21:46 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Tue, 13 Mar 2012 20:46:55 +0000 (21:46 +0100)
The ProcRef and InputSource are now also cleared, and just to be sure there
are no surviving adapters, the child is killed when engine startup fails.

backend.c

index b1d35a9..726b2d3 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -8378,6 +8378,9 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats.
                _(cps->which), cps->program, cps->host, message);
        RemoveInputSource(cps->isr);
        if(appData.icsActive) DisplayFatalError(buf1, 0, 1); else {
+           cps->isr = NULL;
+           DestroyChildProcess(cps->pr, 9 ); // just to be sure
+           cps->pr = NoProc; 
            if(cps == &first) {
                appData.noChessProgram = TRUE;
                gameMode = MachinePlaysBlack; ModeHighlight(); // kludge to unmark Machine Black menu