CefBrowser::DestroyBrowser ?

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.

CefBrowser::DestroyBrowser ?

Postby jacadcaps » Mon Nov 30, 2009 4:11 am

In my application I have to dynamically create and remove many browsers in the root window of the application. Is there a way to dispose a browser once created? I cannot seem to find a proper way to do this. I'm using a separate UI thread for Cef here.
jacadcaps
Newbie
 
Posts: 6
Joined: Mon Nov 30, 2009 3:58 am

Re: CefBrowser::DestroyBrowser ?

Postby magreenblatt » Mon Nov 30, 2009 12:24 pm

You can destroy a browser window using the following code:
Code: Select all
PostMessage(browser->GetWindowHandle(), WM_CLOSE, 0, 0);

Keep in mind, though, that the actual underlying memory for the browser window will not be released until all references to the browser are released.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefBrowser::DestroyBrowser ?

Postby jacadcaps » Wed Dec 02, 2009 8:19 am

Keep in mind, though, that the actual underlying memory for the browser window will not be released until all references to the browser are released.


Yeah, I get that. Was just a bit confused by the API. I still think it'd be nice to have a destroy call - one that'd guarantee that the browser is gone when the call exits, even with the separate thread model.
jacadcaps
Newbie
 
Posts: 6
Joined: Mon Nov 30, 2009 3:58 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 67 guests