Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions common/windows/delphi/chromium/Keyman.UI.UframeCEFHost.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down