Page 1 of 1

Cef closing issue

PostPosted: Fri May 05, 2017 7:14 am
by JohnConnor
hello guys,

I've finished building the cef embeded application, which works as a separate process beside the main application. (used CefGlue)
All if fine except I can not properly close it.
So the overall I have the following sequence:
1. Create new cefEmbeded process with 2 subprocesses for browser and renderer.
2. Load page here
3. Interact with the page and close the application.

Also a thing worth mentionin i think - I am not using the CefRunMessageLoop() - only calling these:
Code: Select all
CefBrowserHost.CreateBrowser(windowInfo, client, settings, "http://www.fastStart.eu", CefRequestContext.GetGlobalContext());
// and then calling several page loads as follows
client.GetBrowser().GetMainFrame().LoadUrl("http://www.fastStart.eu/AccountStartup");


This is all I want to get for the moment and the page loads work just fine. The problem is that the process does not get closed after I call CefRuntime.ShutDown();

I've read the documentation of CEF more than once, but still could not find a proper closing guide. There must be something missing in beneath the bones of cef, which I am definitely missing.

Thansk in advance!

Re: Cef closing issue

PostPosted: Sun May 07, 2017 10:14 am
by Czarek
If you don't run CEF message loop (or work) don't expect CEF to work properly.

Re: Cef closing issue

PostPosted: Mon May 08, 2017 12:57 am
by JohnConnor
Hey,
Thanks for the reply.
Gona try the message loop way than.
I simply tried to check the smallest example i found in the cefGlue solution, which was the "CefGlue.Samples.WpfOsr". And that example was not using the MessageLoop so though it's not an essential peace.... the documentation of the cef also does not mention this a key component, so in case it is a key component I think would be good to mention this in documentation (just my opinion though)

Thanks again and will try to keep this posted until done so I could share the problems I encountered :)

good luck everyone!

br,
jc

Re: Cef closing issue

PostPosted: Mon May 08, 2017 5:59 am
by fddima
CefGlue.Samples.WpfOsr uses multi-threaded msg loop, enabled in CefSettings. Read more about this mode. In short it starts own message loop on separate thread. But usually using of CefRunMessageLoop is enough.

Re: Cef closing issue

PostPosted: Wed Jul 05, 2017 3:07 pm
by AndyB
Try to Dispose all browser objects before calling Xilium.CefGlue.CefRuntime.Shutdown(). This solved the closing issue for me.