From cd09c1f0a427cdce02abb65d05dc7279a1557c99 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 9 Mar 2016 10:53:35 +0100 Subject: [PATCH] Logout from ICS after fatal error Exiting of XBoard after a fatal error such as crashing of the engine could be delayed by popping up an exit message, which then had to be confirmed first. This would leave XBoard in zippy mode open for new challenges, which it would even accept, and lose by forfeit. Now we send a 'logout' command to the ICS before popping up the exit message. --- dialogs.c | 1 + winboard/winboard.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dialogs.c b/dialogs.c index 6380b77..5eb3687 100644 --- a/dialogs.c +++ b/dialogs.c @@ -2364,6 +2364,7 @@ DisplayFatalError (String message, int error, int status) } if(mainOptions[W_BOARD].handle) { if (appData.popupExitMessage) { + if(appData.icsActive) SendToICS("logout\n"); // [HGM] make sure no new games will be started ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE); } else { ExitEvent(status); diff --git a/winboard/winboard.c b/winboard/winboard.c index 424daa5..c6a443e 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -3753,6 +3753,7 @@ void DrawSeekClose() { } + VOID HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) { @@ -8513,6 +8514,7 @@ DisplayFatalError(char *str, int error, int exitStatus) fprintf(debugFP, "%s: %s\n", label, str); } if (appData.popupExitMessage) { + if(appData.icsActive) SendToICS("logout\n"); // [HGM] make sure no new games will be started! (void) MessageBox(hwndMain, str, label, MB_OK| (exitStatus ? MB_ICONSTOP : MB_ICONINFORMATION)); } -- 1.7.0.4