From 16488e55643485de8e40a3d3a40a85dee454998a Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 4 Nov 2024 17:08:58 -0500 Subject: [PATCH] Free CefMenuRunnerViews on BrowserView destruction (see #3790) CefMenuRunnerViews holds a raw_ptr that must be cleared during CefBrowserViewImpl destruction. --- libcef/browser/alloy/alloy_browser_host_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 63d1ba47a..d5ba002dc 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -551,6 +551,10 @@ void AlloyBrowserHostImpl::WindowDestroyed() { CEF_REQUIRE_UIT(); DCHECK(!window_destroyed_); window_destroyed_ = true; + + // Destroy objects that may reference the window. + menu_manager_.reset(nullptr); + CloseBrowser(true); } @@ -929,8 +933,9 @@ void AlloyBrowserHostImpl::PrintCrossProcessSubframe( int document_cookie, content::RenderFrameHost* subframe_host) const { auto* client = printing::PrintCompositeClient::FromWebContents(web_contents); - if (client) + if (client) { client->PrintCrossProcessSubframe(rect, document_cookie, subframe_host); + } } content::WebContents* AlloyBrowserHostImpl::OpenURLFromTab(