You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-08-04 21:32:54 +02:00
Fixed circular reference in TCustomCefUrlrequestClient
Added the TCefApplication.DisableBackgroundNetworking and TCefApplication.MetricsRecordingOnly properties
This commit is contained in:
@@ -85,10 +85,12 @@ type
|
||||
// Custom
|
||||
procedure doOnCreateURLRequest;
|
||||
|
||||
procedure DestroyRequestClient;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure AfterConstruction; override;
|
||||
procedure BeforeDestruction; override;
|
||||
|
||||
procedure AddURLRequest;
|
||||
|
||||
@@ -133,13 +135,6 @@ begin
|
||||
FOnCreateURLRequest := nil;
|
||||
end;
|
||||
|
||||
destructor TCEFUrlRequestClientComponent.Destroy;
|
||||
begin
|
||||
FClient := nil;
|
||||
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TCEFUrlRequestClientComponent.AfterConstruction;
|
||||
begin
|
||||
inherited AfterConstruction;
|
||||
@@ -148,6 +143,27 @@ begin
|
||||
FClient := TCustomCefUrlrequestClient.Create(self);
|
||||
end;
|
||||
|
||||
procedure TCEFUrlRequestClientComponent.BeforeDestruction;
|
||||
begin
|
||||
DestroyRequestClient;
|
||||
|
||||
inherited BeforeDestruction;
|
||||
end;
|
||||
|
||||
procedure TCEFUrlRequestClientComponent.DestroyRequestClient;
|
||||
begin
|
||||
try
|
||||
if (FClient <> nil) then
|
||||
begin
|
||||
FClient.RemoveReferences;
|
||||
FClient := nil;
|
||||
end;
|
||||
except
|
||||
on e : exception do
|
||||
if CustomExceptionHandler('TCEFUrlRequestClientComponent.DestroyRequestClient', e) then raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCEFUrlRequestClientComponent.doOnRequestComplete(const request: ICefUrlRequest);
|
||||
begin
|
||||
if assigned(FOnRequestComplete) then FOnRequestComplete(self, request);
|
||||
|
Reference in New Issue
Block a user