Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Access violation on shutdown

Post Reply
User avatar
salvadordf
Posts: 4040
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Access violation on shutdown

Post by salvadordf »

Hi,

FrmBrowser.pas is missing and I can't compile this demo.

I took a quick look and I didn't see this demo was using the TForm.OnCloseQuery event to close the child browsers before closing the main form.
All applications with child browsers must wait until all of them are properly closed before allowing the main form to be closed.

Use the ToolBoxBrowser demo as a reference and copy the code to close the child forms.
User avatar
salvadordf
Posts: 4040
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Access violation on shutdown

Post by salvadordf »

Use the destruction steps described in the SimpleBrowser demo for each browser. Read the code comments in that demo.

In any case, the application should wait for all the browsers to be closed following the destruction steps before closing the main form.
It doesn't matter if the browsers are inside child forms, frames, tabs, etc.

Only when all browsers have triggered the OnBeforeClose event you can close the application safely.

Also remember that :
  • Most of the TChromium and TChromiumWindow events are executed in a different thread and the VCL should only be handled in the main application thread. The demos are kept as simple as possible and most of the times they ignore this point but you should send windows messages from the TChromium events to the form to handle the VCL or you might have some issues.
  • Recent CEF versions have some issues with some new features and they cause some issues too. Add this code line before the GlobalCEFApp.StartMainProcess call in the DPR file.

Code: Select all

GlobalCEFApp.DisableFeatures  := 'NetworkService,OutOfBlinkCors';
Post Reply