From: H.G. Muller Date: Thu, 7 Jan 2010 15:19:25 +0000 (+0100) Subject: Fix crash on clicking EngineOutput window after using menu dialog X-Git-Tag: hgm-4.20100107~6 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=17049411c26637cd99e4aaf43ee2f11ef468e00e Fix crash on clicking EngineOutput window after using menu dialog The copy-from-engine-output patch involved calling SetFocus for the EngineOutput memos, which led to a crash if the last focus-carrying widget was in the mean time destroyed by closing the dialog. The various dialog-PopDown functions now invalidate the active widget. --- diff --git a/xoptions.c b/xoptions.c index 7532dab..3151c31 100644 --- a/xoptions.c +++ b/xoptions.c @@ -246,6 +246,7 @@ int tcIncrement, tcMoves; void TimeControlPopDown() { if (!TimeControlUp) return; + previous = NULL; XtPopdown(TimeControlShell); XtDestroyWidget(TimeControlShell); TimeControlUp = False; @@ -568,6 +569,7 @@ Widget engDrawMoves, engThreshold, engRule, engRepeat; void EnginePopDown() { if (!EngineUp) return; + previous = NULL; XtPopdown(EngineShell); XtDestroyWidget(EngineShell); EngineUp = False; @@ -1126,6 +1128,7 @@ struct UciControl controlDesc[] = { void UciPopDown() { if (!UciUp) return; + previous = NULL; XtPopdown(UciShell); XtDestroyWidget(UciShell); UciUp = False; @@ -1324,6 +1327,7 @@ ChessProgramState *currentCps; void SettingsPopDown() { if (!SettingsUp) return; + previous = NULL; XtPopdown(SettingsShell); XtDestroyWidget(SettingsShell); SettingsUp = False;