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.

Update to CEF 3.3325.1756.g6d8faa4

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

Update to CEF 3.3325.1756.g6d8faa4

Post by salvadordf »

Hi,

I've updated CEF4Delphi to CEF 3.3325.1756.g6d8faa4.

This is what's new :
  • Now all the demos destroy the browsers following the destruction sequence. This is what the official CEF demo does and it's a necessary step to have a clean shutdown.
  • New GlobalCEFApp.WidevinePath property and GlobalCEFApp.OnCDMRegistrationComplete event to register Widevine automatically.
  • New TChromium.OnBrowserCompMsg, TChromium.OnWidgetCompMsg and TChromium.OnRenderCompMsg events to intercept all missing messages. The MiniBrowser demo uses one of them to show the mouse coordinates in real time. This feature uses the code given by Winexcel. Thanks! :D
  • New GlobalCEFApp.ChildProcessesCount property in case you want to delay the GlobalCEFApp destruction if there are still some running child processes.
The CEF3 libraries used in this update are :
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3325.1756.g6d8faa4

Post by salvadordf »

Winexcel wrote: Sun Apr 01, 2018 5:39 am Could you explain what was the reason for the shutdown crash?
I still haven't found the reason but destroying the browsers before closing the main form is recommended by CEF3.
In fact, every time someone reports a shutdown crash in the official CEF3 forum you will see the same recommendations :
  • Check if you release all interfaces.
  • Wait until you receive the OnBeforeClose event before shutting down.

Winexcel wrote: Sun Apr 01, 2018 6:09 am Salvador, I've just gotten the shutdown crash. I recorded a video with the bug below.
https://www.youtube.com/watch?v=pMUFBO2YW1E
The MiniBrowser demo uses the same EXE for all subprocesses and the code before GlobalCEFApp.StartMainProcess is executed by all the processes.

In this case, the browser, render and GPU processes will have the memory leak induced by the AllocMem(10) line and FastMM will try to report the leak in all processes with a modal dialog (MessageBoxA).

This is not the first bug report that shows a crash when the app has a ReportMemoryLeaksOnShutdown set to TRUE. Other user showed a similar crash when he used ReportMemoryLeaksOnShutdown after GlobalCEFApp.StartMainProcess.

Perhaps there's a compatibility problem between FastMM and CEF3.
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 3.3325.1756.g6d8faa4

Post by thefunkyjoint »

Great job Salvador :D
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3325.1756.g6d8faa4

Post by salvadordf »

I made a small change to subclass the CEF windows only once because TChromium.OnRenderViewReady is called again if you load a different website.

If I allow to subclass the windows a second time then CallWindowProc causes an access violation. :o
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3325.1756.g6d8faa4

Post by salvadordf »

I'm very busy again... :(

I'll try to figure out what's going on with those events in a few days.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 3.3325.1756.g6d8faa4

Post by salvadordf »

I will add it.

Thanks! :D
Post Reply