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

Always run TryCloseBrowser in the CEF UI thread

This commit is contained in:
Salvador Díaz Fau
2024-09-12 12:42:58 +02:00
parent b5e337f36c
commit aba0ec399c
4 changed files with 67 additions and 6 deletions

View File

@ -197,6 +197,11 @@ type
procedure Execute; override;
end;
TCefTryCloseBrowserTask = class(TCefChromiumTask)
protected
procedure Execute; override;
end;
implementation
uses
@ -677,4 +682,22 @@ begin
end;
end;
// TCefTryCloseBrowserTask
procedure TCefTryCloseBrowserTask.Execute;
begin
try
try
if CanExecute then
IChromiumEvents(FEvents).doTryCloseBrowser;
except
on e : exception do
if CustomExceptionHandler('TCefTryCloseBrowserTask.Execute', e) then raise;
end;
finally
FEvents := nil;
end;
end;
end.