AV when exit app using cef4delphi

delphi package - automated exception handling
Post Reply
softtouch
Posts: 105
Joined: Sat Jun 20, 2009 10:08 am
Contact:

AV when exit app using cef4delphi

Post by softtouch »

When I create an app, using CEF4Delphi, and I exit the app, I get an AV which I cannot resolve.
But when I disable madExcept dfor that Project, there is no AV, all works fine. The moment I enable madExcept, I again get the AV on exit.

I did not get any issue with Delphi 10.x, only with 11.x and the updated madExcept.

This is a sample code:

Code: Select all

uses
  madExcept,
  madLinkDisAsm,
  madListHardware,
  madListProcesses,
  madListModules,
  Winapi.Windows,
  Vcl.Forms,
  uCEFApplication,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  GlobalCEFApp := TCefApplication.Create;

  GlobalCEFApp.FrameworkDirPath     := '.\cef';
  GlobalCEFApp.ResourcesDirPath     := '.\cef';
  GlobalCEFApp.LocalesDirPath       := '.\cef\locales';
  GlobalCEFApp.EnableGPU            := True;      // Enable hardware acceleration
  GlobalCEFApp.cache                := '.\cef\cache';
  GlobalCEFApp.UserDataPath         := '.\cef\User Data';

  if GlobalCEFApp.StartMainProcess then
  begin
//	  Application.Initialize;
//  	Application.MainFormOnTaskbar := True;
//	  Application.CreateForm(TForm1, Form1);
//		Application.Run;
  end;

  GlobalCEFApp.Free;	// <= crash with AV, but only when madExcept is enabled
end.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: AV when exit app using cef4delphi

Post by madshi »

Why do you even have to free that thing before your process shuts down? I'd suggest to simply skip that, it's most probably not needed. The OS is extremely good at automatically freeing everything you forgot to free, after your process shuts down.
softtouch
Posts: 105
Joined: Sat Jun 20, 2009 10:08 am
Contact:

Re: AV when exit app using cef4delphi

Post by softtouch »

When I dont free it, the AV popup a moment after the app shutdown.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: AV when exit app using cef4delphi

Post by madshi »

Do you have secondary threads running? They all need to be run through before the application can close.

Please post the AV crash report when you don't free that thing.
Post Reply