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,9 +57,9 @@ uses
{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextCreated := GlobalCEFApp_OnContextCreated;
GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
// 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
@ -71,6 +71,5 @@ begin
Application.Run;
end;
GlobalCEFApp.Free;
GlobalCEFApp := nil;
DestroyGlobalCEFApp;
end.

View File

@ -110,11 +110,7 @@ var
GlobalCallbackFunc : ICefv8Value = nil;
GlobalCallbackContext : ICefv8Context = nil;
procedure GlobalCEFApp_OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context);
procedure GlobalCEFApp_OnProcessMessageReceived(const browser : ICefBrowser;
sourceProcess : TCefProcessId;
const aMessage : ICefProcessMessage;
var aHandled : boolean);
procedure CreateGlobalCEFApp;
implementation
@ -171,6 +167,13 @@ begin
aHandled := False;
end;
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.OnContextCreated := GlobalCEFApp_OnContextCreated;
GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;
end;
procedure TJSExecutingFunctionsFrm.GoBtnClick(Sender: TObject);
begin
Chromium1.LoadURL(Edit1.Text);