cef3 create and destroy browser

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

cef3 create and destroy browser

Postby paulkatto » Tue Mar 26, 2013 12:25 pm

Hi,

I'm using cef3 trunk version in offscreen render mode and I am having trouble closing and opening browser instances. My offscreen rendering is not attached to any HWND handle, I just use the whole thing to upload the contents to an OGL texture. I tried all sort of things:

offscreenClient->GetBrowser()->GetHost()->CloseBrowser()
and/or
offscreenClient->GetBrowser()->Release()
and/or
offscreenClient->Release()

Where offscreenClient inherits:

CefClient,
CefContextMenuHandler,
CefDisplayHandler,
CefDownloadHandler,
CefGeolocationHandler,
CefKeyboardHandler,
CefLifeSpanHandler,
CefLoadHandler,
CefRenderHandler,
CefRequestHandler


without success. Somewhere in the system the instance is still registered calling e.g. GetViewportSize. Eventually the whole thing crashes. Is there some reliable way to destroy a Browser instance?

Thanks,

Paul
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am

Re: cef3 create and destroy browser

Postby magreenblatt » Tue Mar 26, 2013 2:02 pm

What revision are you using? CefBrowserHost::CloseBrowser() is the correct method.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cef3 create and destroy browser

Postby paulkatto » Tue Mar 26, 2013 2:29 pm

using 1138.... should I upgrade?
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am

Re: cef3 create and destroy browser

Postby magreenblatt » Tue Mar 26, 2013 3:02 pm

paulkatto wrote:using 1138.... should I upgrade?

Probably. The shutdown procedure has changed. See comments on CefLifeSpanHandler::DoClose() after you update.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cef3 create and destroy browser

Postby paulkatto » Wed Mar 27, 2013 1:06 pm

for the record: the problem was me returning true in DoClose, replacing that with false did the trick. Thanks for your suggestion (to read the doc!).

Paul
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 199 guests