magreenblatt wrote:Remove the BrowserView from the parent View first and then call CloseBrowser(true)?
magreenblatt wrote:Are you releasing all references to the CefBrowserView and CefBrowser? Are you returning true from DoClose? See also the DoClose documentation: https://github.com/chromiumembedded/cef ... ler.h#L106
void AlloyBrowserHostImpl::CloseBrowser(bool force_close) {
if (CEF_CURRENTLY_ON_UIT()) {
// Exit early if a close attempt is already pending and this method is
// called again from somewhere other than WindowDestroyed().
if (destruction_state_ >= DESTRUCTION_STATE_PENDING &&
(IsWindowless() || !window_destroyed_)) {
if (force_close && destruction_state_ == DESTRUCTION_STATE_PENDING) {
// Upgrade the destruction state.
destruction_state_ = DESTRUCTION_STATE_ACCEPTED;
}
return;
}
if (destruction_state_ < DESTRUCTION_STATE_ACCEPTED) {
destruction_state_ = (force_close ? DESTRUCTION_STATE_ACCEPTED
: DESTRUCTION_STATE_PENDING);
}
content::WebContents* contents = web_contents();
if (contents && contents->NeedToFireBeforeUnloadOrUnloadEvents()) {
// Will result in a call to BeforeUnloadFired() and, if the close isn't
// canceled, CloseContents().
contents->DispatchBeforeUnload(false /* auto_cancel */);
} else {
CloseContents(contents);
}
} else {
CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::CloseBrowser,
this, force_close));
}
}
void AlloyBrowserHostImpl::WindowDestroyed() {
CEF_REQUIRE_UIT();
DCHECK(!window_destroyed_);
window_destroyed_ = true;
CloseBrowser(true);
}
// static
CefRefPtr<CefBrowserView> CefBrowserView::GetForBrowser(
CefRefPtr<CefBrowser> browser) {
CEF_REQUIRE_UIT_RETURN(nullptr);
CefBrowserHostBase* browser_impl =
static_cast<CefBrowserHostBase*>(browser.get());
if (browser_impl && browser_impl->is_views_hosted())
return browser_impl->GetBrowserView();
return nullptr;
}
Users browsing this forum: Google [Bot] and 93 guests