You've already forked CEF4Delphi
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:
@ -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.
|
||||
|
Reference in New Issue
Block a user