1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Partial fix for issue #291

- Create the CefApp handlers only when they are needed in SingleProcess mode.
- Added several "RemoveReferences" procedures to disable events when the application is shutting down in the CefApp handlers.
This commit is contained in:
Salvador Diaz Fau
2020-11-10 15:02:49 +01:00
parent 9ac740613c
commit e72db93dd2
9 changed files with 164 additions and 65 deletions

View File

@ -90,6 +90,8 @@ type
procedure OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer); override;
procedure OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring); override;
procedure RemoveReferences; override;
public
constructor Create(const aCefApp : TCefApplicationCore); reintroduce; virtual;
destructor Destroy; override;
@ -273,11 +275,16 @@ end;
destructor TCustomRenderLoadHandler.Destroy;
begin
FCefApp := nil;
RemoveReferences;
inherited Destroy;
end;
procedure TCustomRenderLoadHandler.RemoveReferences;
begin
FCefApp := nil;
end;
procedure TCustomRenderLoadHandler.OnLoadEnd(const browser : ICefBrowser;
const frame : ICefFrame;
httpStatusCode : Integer);