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

Update to CEF 3.3239.1710.g85f637a

Fixed an initialization bug in MDIBrowser, TabBrowser and ToolBoxBrowser
Added several procedures to clear interface and class references before destruction
This commit is contained in:
Salvador Díaz Fau
2017-12-27 14:05:33 +01:00
parent 984c87cc03
commit 9c9a9f59c7
16 changed files with 352 additions and 130 deletions

View File

@@ -53,6 +53,7 @@ type
TCefDeleteCookiesCallbackOwn = class(TCefBaseRefCountedOwn, ICefDeleteCookiesCallback)
protected
procedure OnComplete(numDeleted: Integer); virtual; abstract;
procedure InitializeVars; virtual; abstract;
public
constructor Create; virtual;
@@ -66,6 +67,8 @@ type
public
constructor Create(const callback: TCefDeleteCookiesCallbackProc); reintroduce;
destructor Destroy; override;
procedure InitializeVars; override;
end;
TCefCustomDeleteCookiesCallback = class(TCefDeleteCookiesCallbackOwn)
@@ -76,6 +79,8 @@ type
public
constructor Create(const aChromiumBrowser : TObject); reintroduce;
destructor Destroy; override;
procedure InitializeVars; override;
end;
implementation
@@ -108,7 +113,19 @@ end;
procedure TCefFastDeleteCookiesCallback.OnComplete(numDeleted: Integer);
begin
FCallback(numDeleted)
if assigned(FCallback) then FCallback(numDeleted)
end;
destructor TCefFastDeleteCookiesCallback.Destroy;
begin
InitializeVars;
inherited Destroy;
end;
procedure TCefFastDeleteCookiesCallback.InitializeVars;
begin
FCallback := nil;
end;
// TCefCustomDeleteCookiesCallback
@@ -120,6 +137,18 @@ begin
FChromiumBrowser := aChromiumBrowser;
end;
destructor TCefCustomDeleteCookiesCallback.Destroy;
begin
InitializeVars;
inherited Destroy;
end;
procedure TCefCustomDeleteCookiesCallback.InitializeVars;
begin
FChromiumBrowser := nil;
end;
procedure TCefCustomDeleteCookiesCallback.OnComplete(numDeleted: Integer);
begin
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then