Free CefMenuRunnerViews on BrowserView destruction (see #3790)

CefMenuRunnerViews holds a raw_ptr<CefBrowserViewImpl> that must be
cleared during CefBrowserViewImpl destruction.
This commit is contained in:
Marshall Greenblatt 2024-11-04 17:08:58 -05:00
parent 43fc50a89e
commit be11f21131
1 changed files with 6 additions and 1 deletions

View File

@ -551,6 +551,10 @@ void AlloyBrowserHostImpl::WindowDestroyed() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK(!window_destroyed_); DCHECK(!window_destroyed_);
window_destroyed_ = true; window_destroyed_ = true;
// Destroy objects that may reference the window.
menu_manager_.reset(nullptr);
CloseBrowser(true); CloseBrowser(true);
} }
@ -929,8 +933,9 @@ void AlloyBrowserHostImpl::PrintCrossProcessSubframe(
int document_cookie, int document_cookie,
content::RenderFrameHost* subframe_host) const { content::RenderFrameHost* subframe_host) const {
auto* client = printing::PrintCompositeClient::FromWebContents(web_contents); auto* client = printing::PrintCompositeClient::FromWebContents(web_contents);
if (client) if (client) {
client->PrintCrossProcessSubframe(rect, document_cookie, subframe_host); client->PrintCrossProcessSubframe(rect, document_cookie, subframe_host);
}
} }
content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab( content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(