From e51a89e6260b6a482db891505db100437609d86f Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 4 Apr 2010 23:37:59 +0000 Subject: [PATCH] LCL: TWinControl.WndProc LM_SETFOCUS: check csDestroying git-svn-id: trunk@24418 - --- lcl/include/wincontrol.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index cf1c1b0ecb..5b1dc7752c 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -5074,7 +5074,8 @@ begin {$IFDEF VerboseFocus} DebugLn('TWinControl.WndProc LM_SetFocus ',DbgSName(Self)); {$ENDIF} - if not (csDestroyingHandle in ControlState) then + if (not (csDestroyingHandle in ControlState)) + and (not (csDestroying in ComponentState)) then begin Form := GetParentForm(Self); if (Form <> nil) and not Form.SetFocusedControl(Self) then Exit;