fix(developer): handle window already destroyed when closing editor

Fixes: #15617
Fixes: KEYMAN-DEVELOPER-1JD
Fixes: KEYMAN-DEVELOPER-36K
Fixes: KEYMAN-DEVELOPER-2P5
Test-bot: skip
This commit is contained in:
Marc Durdin 2026-02-24 15:35:44 +01:00
parent bc546d004c
commit 0bd6f59382

View file

@ -303,7 +303,7 @@ end;
function TframeCEFHost.HasFocus: Boolean;
begin
AssertVclThread;
Result := cefwp.HandleAllocated and IsChild(cefwp.Handle, GetFocus);
Result := Assigned(cefwp) and cefwp.HandleAllocated and IsChild(cefwp.Handle, GetFocus);
end;
procedure TframeCEFHost.Handle_CEF_SHOW(var message: TMessage);
@ -574,7 +574,8 @@ end;
procedure TframeCEFHost.Handle_CEF_DESTROY(var Message: TMessage);
begin
AssertVclThread;
cefwp.DestroyChildWindow;
if Assigned(cefwp) then
cefwp.DestroyChildWindow;
FreeAndNil(cefwp);
end;