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

Browser can be destroyed while in event. Do not access after that.

This commit is contained in:
martin
2021-02-24 05:11:29 +01:00
parent 2838b7964e
commit cee41f519b

View File

@ -5184,9 +5184,11 @@ end;
function TChromiumCore.doOnClose(const browser: ICefBrowser): Boolean; function TChromiumCore.doOnClose(const browser: ICefBrowser): Boolean;
var var
TempAction : TCefCloseBrowserAction; TempAction : TCefCloseBrowserAction;
id: Integer;
begin begin
Result := False; Result := False;
TempAction := cbaClose; TempAction := cbaClose;
id := browser.Identifier;
// TempAction values // TempAction values
// ----------------- // -----------------
@ -5205,11 +5207,11 @@ begin
cbaDelay : cbaDelay :
begin begin
Result := True; Result := True;
SetBrowserIsClosing(browser.Identifier); SetBrowserIsClosing(id);
end; end;
else else
SetBrowserIsClosing(browser.Identifier); SetBrowserIsClosing(id);
end; end;
end; end;