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

Added GlobalCEFApp.DisablePDFExtension property

- Bug fix #89
- New SimpleLazOSRBrowser demo
This commit is contained in:
Salvador Díaz Fau
2018-06-17 14:18:11 +02:00
parent 8519c9b5d5
commit bf402109bf
61 changed files with 2141 additions and 583 deletions

View File

@ -57,8 +57,9 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextCreated := GlobalCEFApp_OnContextCreated;
// GlobalCEFApp creation and initialization moved to a different unit to fix the memory leak described in the bug #89
// https://github.com/salvadordf/CEF4Delphi/issues/89
CreateGlobalCEFApp;
if GlobalCEFApp.StartMainProcess then
begin
@ -70,6 +71,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -94,7 +94,7 @@ type
var
JSWindowBindingWithFunctionFrm: TJSWindowBindingWithFunctionFrm;
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
procedure CreateGlobalCEFApp;
implementation
@ -129,6 +129,12 @@ begin
context.Global.SetValueByKey('myfunc', TempFunction, V8_PROPERTY_ATTRIBUTE_NONE);
end;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextCreated := GlobalCEFApp_OnContextCreated;
end;
procedure TJSWindowBindingWithFunctionFrm.GoBtnClick(Sender: TObject);
begin
Chromium1.LoadURL(Edit1.Text);