Cef closing issue

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Cef closing issue

Postby JohnConnor » Fri May 05, 2017 7:14 am

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!
JohnConnor
Techie
 
Posts: 21
Joined: Tue Mar 21, 2017 2:27 am

Re: Cef closing issue

Postby Czarek » Sun May 07, 2017 10:14 am

If you don't run CEF message loop (or work) don't expect CEF to work properly.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Cef closing issue

Postby JohnConnor » Mon May 08, 2017 12:57 am

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
JohnConnor
Techie
 
Posts: 21
Joined: Tue Mar 21, 2017 2:27 am

Re: Cef closing issue

Postby fddima » Mon May 08, 2017 5:59 am

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.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Cef closing issue

Postby AndyB » Wed Jul 05, 2017 3:07 pm

Try to Dispose all browser objects before calling Xilium.CefGlue.CefRuntime.Shutdown(). This solved the closing issue for me.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 16 guests