Hi,
I updated CEF4Delhi to CEF 3.3359.1768.g8e7c5d6 which includes Chromium 66.0.3359.117.
I did some minor modifications to the SimpleFMXBrowser demo to destroy the form safely.
These are the CEF binaries used in this update :
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.3359.1768.g8e7c5d6
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
-
- Posts: 461
- Joined: Thu Aug 10, 2017 12:40 pm
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Update to CEF 3.3359.1768.g8e7c5d6
Hi,
Please provide a code sample to reproduce the error.
Do you have that problem with the SimpleBrowser demo?
What Delphi version are you using?
Thanks!
Please provide a code sample to reproduce the error.
Do you have that problem with the SimpleBrowser demo?
What Delphi version are you using?
Thanks!
-
- Posts: 8
- Joined: Mon Jul 10, 2017 8:08 am
Re: Update to CEF 3.3359.1768.g8e7c5d6
Please comment out this line:
// GlobalCEFApp.Free;
// GlobalCEFApp.Free;
-
- Posts: 461
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Update to CEF 3.3359.1768.g8e7c5d6
Why this line should be commented ? In my apps this line is always active.
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Update to CEF 3.3359.1768.g8e7c5d6
I had to edit your post. Please, don't send EXE files.
That file was detected by 3 antivirus engines as infected.
I'll try to modify the SimpleBrowser demo to set the dimensions of TChromiumWindow manually but it would be best if you could post pascal code, not executables.
That file was detected by 3 antivirus engines as infected.
I'll try to modify the SimpleBrowser demo to set the dimensions of TChromiumWindow manually but it would be best if you could post pascal code, not executables.
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Update to CEF 3.3359.1768.g8e7c5d6
I tested your code and I couldn't replicate that error.
However, there are several things missing in that code :
However, there are several things missing in that code :
- You must follow the "Destruction steps" described in the code comments from the SimpleBrowser demo. This is necessary to avoid shutdown problems.
- CreateBrowser must be called after GlobalCEFApp.GlobalContextInitialized is set to TRUE or it will fail. That's why the demos have a TTimer.
- You should add the procedures to handle WM_MOVE, WM_MOVING, WM_ENTERMENULOOP and WM_EXITMENULOOP.
- TChromiumWindow is an extremely simplistic component made to be used as an extremely simple browser. If you need to add anything else it's recommended to use TChromium and TWindowParent. Use the SimpleBrowser2 demo as a template for your app.
- salvadordf
- Posts: 4081
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Update to CEF 3.3359.1768.g8e7c5d6
TChromium.RetrieveHTML is an asynchronous procedure and a TTimer uses a low-priority message : WM_TIMER.
TChromium.RetrieveHTML uses a TCustomCefStringVisitor that calls an internal TChromium procedure to return the HTML in the TChromium.OnTextResultAvailable event.
If you stress your CPU and you try to close the app then the remaining WM_TIMER messages in the queue could cause problems.
The safest way to call TChromium.RetrieveHTML repeatedly would be to wait for the previous TChromium.OnTextResultAvailable event before enabling TTimer again.
Follow these steps if you try to close your app :
TChromium.RetrieveHTML uses a TCustomCefStringVisitor that calls an internal TChromium procedure to return the HTML in the TChromium.OnTextResultAvailable event.
If you stress your CPU and you try to close the app then the remaining WM_TIMER messages in the queue could cause problems.
The safest way to call TChromium.RetrieveHTML repeatedly would be to wait for the previous TChromium.OnTextResultAvailable event before enabling TTimer again.
Follow these steps if you try to close your app :
- Use a boolean global variable to keep your TTimer disabled. You should not enable your timer again if that variable is set.
- Disable the TTimer.
- Wait for any remaining TChromium.OnTextResultAvailable event to be received.
- Start the "destruction sequence" for TChromium.
- Close your app when TChromium.OnBeforeClose is received.