You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-11-23 21:34:53 +02:00
Faster browser destruction
Faster browser destruction. All timers have been removed from the demos. Removed unnecessary client handler class in TChromium. Now there's only an interface. Fixed an old memory leak in popup windows.
This commit is contained in:
@@ -71,6 +71,7 @@ type
|
||||
|
||||
public
|
||||
constructor Create(const events: IChromiumEvents); reintroduce; virtual;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -127,9 +128,19 @@ begin
|
||||
FEvent := events;
|
||||
end;
|
||||
|
||||
destructor TCustomDialogHandler.Destroy;
|
||||
begin
|
||||
FEvent := nil;
|
||||
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TCustomDialogHandler.OnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; acceptFilters: TStrings; selectedAcceptFilter: Integer; const callback: ICefFileDialogCallback): Boolean;
|
||||
begin
|
||||
Result := FEvent.doOnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback);
|
||||
if (FEvent <> nil) then
|
||||
Result := FEvent.doOnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback)
|
||||
else
|
||||
Result := inherited;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user