Page 1 of 1

Re: Not closed Chrome_IOThread, CrBrowserMain, etc...

Posted: Mon Dec 03, 2018 9:53 pm
by salvadordf
GlobalCEFApp needs to be initialized differently.

Most of the demos call GlobalCEFApp.StartMainProcess in the DPR file because they use the same EXE for all the subprocesses. In that case, GlobalCEFApp.StartMainProcess is the condition in a "if..then" clause because "Application.Run" should only be called once.

If your app can't modify the DPR file then you must configure GlobalCEFApp to use a different EXE for the subproceses.

Re: Not closed Chrome_IOThread, CrBrowserMain, etc...

Posted: Mon Dec 03, 2018 9:59 pm
by salvadordf
It doesn't matter if the app uses the browser a lot or infrequently. CEF3 needs to be initialized in a precise way or the app could have problems like this one.

Re: Not closed Chrome_IOThread, CrBrowserMain, etc...

Posted: Tue Dec 04, 2018 7:14 am
by salvadordf
I would suggest to copy the initialization procedures from the "SubProcess" demo to your application.

That demo uses the uCEFLoader.pas unit to initialize and finalize CEF in the "initialization" and "finalization" sections.
It uses a different EXE for the subprocesses so it doesn't need to call GlobalCEFApp.StartMainProcess in the DPR file.

After that, open the ToolBoxBrowser demo and read the code comments about the browser destruction sequence in uMainForm.pas and uChildForm.pas. You need to follow those steps in order to close your app safely.