From 0bd6f59382dda18f730ae4a59301b70ec9af2d8f Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 24 Feb 2026 15:35:44 +0100 Subject: [PATCH] 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 --- common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas b/common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas index bffcd952d2a..19f84b40c34 100644 --- a/common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas +++ b/common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas @@ -303,7 +303,7 @@ function TframeCEFHost.GetDebugInfo: string; 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 @@ procedure TframeCEFHost.cefClose(Sender: TObject; const browser: ICefBrowser; procedure TframeCEFHost.Handle_CEF_DESTROY(var Message: TMessage); begin AssertVclThread; - cefwp.DestroyChildWindow; + if Assigned(cefwp) then + cefwp.DestroyChildWindow; FreeAndNil(cefwp); end;