1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Faster browser destruction

Faster browser destruction. All timers have been removed from the demos.
Removed unnecessary client handler class in TChromium. Now there's only
an interface.
Fixed an old memory leak in popup windows.
This commit is contained in:
Salvador Diaz Fau
2017-06-11 17:48:20 +02:00
parent d0c7e0926e
commit 830117e0ca
47 changed files with 1118 additions and 864 deletions

View File

@@ -72,6 +72,7 @@ type
public
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
destructor Destroy; override;
end;
implementation
@@ -145,24 +146,31 @@ begin
FEvent := events;
end;
destructor TCustomLoadHandler.Destroy;
begin
FEvent := nil;
inherited Destroy;
end;
procedure TCustomLoadHandler.OnLoadEnd(const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
begin
FEvent.doOnLoadEnd(browser, frame, httpStatusCode);
if (FEvent <> nil) then FEvent.doOnLoadEnd(browser, frame, httpStatusCode);
end;
procedure TCustomLoadHandler.OnLoadError(const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
begin
FEvent.doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
if (FEvent <> nil) then FEvent.doOnLoadError(browser, frame, errorCode, errorText, failedUrl);
end;
procedure TCustomLoadHandler.OnLoadingStateChange(const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean);
begin
FEvent.doOnLoadingStateChange(browser, isLoading, canGoBack, canGoForward);
if (FEvent <> nil) then FEvent.doOnLoadingStateChange(browser, isLoading, canGoBack, canGoForward);
end;
procedure TCustomLoadHandler.OnLoadStart(const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType);
begin
FEvent.doOnLoadStart(browser, frame, transitionType);
if (FEvent <> nil) then FEvent.doOnLoadStart(browser, frame, transitionType);
end;
end.