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.

How to create and destroy browser form?

andreykrasnodar
Posts: 112
Joined: Wed Jul 01, 2020 10:22 am

Re: How to create and destroy browser form?

Post by andreykrasnodar »

If I put this string

Code: Select all

cefshutdown;
in my project after

Code: Select all

Application.Run;
it hangs the program on exit, but after closing the application there is no application in task manager.
andreykrasnodar
Posts: 112
Joined: Wed Jul 01, 2020 10:22 am

Re: How to create and destroy browser form?

Post by andreykrasnodar »

Hope I fix the bug using code from demo's:

Code: Select all

  CefSingleProcess := false;
  if not CefLoadLibDefault then
    Exit;
suddenly no errors more. I hope.
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to create and destroy browser form?

Post by salvadordf »

You need to close the browsers following the "destruction steps" described in the code comments of each demo.

It's necessary to close all the browsers properly before destroying GlobalCEFApp.

If you see remaining processes when you close the application, freezes or crashes when you try to destroy GlobalCEFApp, it means that some browser or some other CEF component wasn't properly closed.
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to create and destroy browser form?

Post by salvadordf »

Also remember that the single process mode is not supported by CEF and it should only be used for debugging purposes.
It can cause unexpected issues.
andreykrasnodar
Posts: 112
Joined: Wed Jul 01, 2020 10:22 am

Re: How to create and destroy browser form?

Post by andreykrasnodar »

You're wrong again.
I am using cef3 and is going to use it in the future. There is no GlobalCEFApp in this version. And only shortest instructions in demo. All demo's create 3 process and start with

Code: Select all

CefSingleProcess := false;
if not CefLoadLibDefault then
 Exit;
If CefSingleProcess := false (default) application creates only 1 process and not able to terminate as well on closing main window.
I have added this code into my dpr file and now there are no problems.
Thanks.
Post Reply