mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 04:39:28 +01:00
LCL: TWinControl.WndProc LM_SETFOCUS: check csDestroying for form
git-svn-id: trunk@24421 -
This commit is contained in:
parent
408eb18c12
commit
04c7c63cf7
@ -1970,6 +1970,8 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
if (Control <> nil) and (csDestroying in Control.ComponentState) then Exit;
|
||||
if (csDestroying in ComponentState) or (csDestroyingHandle in ControlState) then
|
||||
exit;
|
||||
|
||||
if (Parent <> nil) then
|
||||
begin
|
||||
|
||||
@ -5074,10 +5074,11 @@ begin
|
||||
{$IFDEF VerboseFocus}
|
||||
DebugLn('TWinControl.WndProc LM_SetFocus ',DbgSName(Self));
|
||||
{$ENDIF}
|
||||
if (not (csDestroyingHandle in ControlState))
|
||||
and (not (csDestroying in ComponentState)) then
|
||||
begin
|
||||
Form := GetParentForm(Self);
|
||||
Form := GetParentForm(Self);
|
||||
if (Form<>nil)
|
||||
and (not (csDestroyingHandle in ControlState))
|
||||
and (not (csDestroying in ComponentState))
|
||||
then begin
|
||||
if (Form <> nil) and not Form.SetFocusedControl(Self) then Exit;
|
||||
Message.Result := 0;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user