From 17049411c26637cd99e4aaf43ee2f11ef468e00e Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 7 Jan 2010 16:19:25 +0100 Subject: [PATCH] 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. --- xoptions.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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; -- 1.7.0.4