1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Fixed TChromium initialization. Now FBrowser is assigned only once.

This commit is contained in:
Salvador Díaz Fau 2018-02-16 19:00:28 +01:00
parent 6905f9a292
commit 2901108ba3
2 changed files with 8 additions and 12 deletions

View File

@ -2786,17 +2786,15 @@ end;
procedure TChromium.doOnAfterCreated(const browser: ICefBrowser);
begin
if (FBrowser = nil) and (browser <> nil) then
if MultithreadApp and (FBrowser = nil) and (browser <> nil) then
begin
FBrowser := browser;
FBrowserId := browser.Identifier;
FBrowser := browser;
FBrowserId := browser.Identifier;
FInitialized := (FBrowserId <> 0);
end;
doUpdatePreferences(browser);
if not(FInitialized) then
FInitialized := (FBrowser <> nil) and (FBrowserId <> 0);
if Assigned(FOnAfterCreated) then FOnAfterCreated(Self, browser);
end;

View File

@ -2488,17 +2488,15 @@ end;
procedure TFMXChromium.doOnAfterCreated(const browser: ICefBrowser);
begin
if (FBrowser = nil) and (browser <> nil) then
if MultithreadApp and (FBrowser = nil) and (browser <> nil) then
begin
FBrowser := browser;
FBrowserId := browser.Identifier;
FBrowser := browser;
FBrowserId := browser.Identifier;
FInitialized := (FBrowserId <> 0);
end;
doUpdatePreferences(browser);
if not(FInitialized) then
FInitialized := (FBrowser <> nil) and (FBrowserId <> 0);
if Assigned(FOnAfterCreated) then FOnAfterCreated(Self, browser);
end;