mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: Trigger CefBrowser destruction on CefBrowserView release (see #3790)
Avoid a circular ownership dependency between CefBrowserViewImpl and CefBrowserPlatformDelegate[Chrome]Views (owned by CefBrowserHostBase). Trigger CefBrowserHostBase destruction when the last CefBrowserViewImpl reference is released. This fixes a number of shutdown crashes related to overlay CefBrowsers still existing at CefShutdown.
This commit is contained in:
@@ -226,6 +226,9 @@ void CefBrowserPlatformDelegate::PopupWebContentsCreated(
|
||||
|
||||
// Associate the PlatformDelegate with the new BrowserView.
|
||||
new_platform_delegate->SetBrowserView(new_browser_view);
|
||||
|
||||
// Keep the BrowserView alive until PopupBrowserCreated() is called.
|
||||
new_browser_view->AddRef();
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegate::PopupBrowserCreated(
|
||||
@@ -263,6 +266,9 @@ void CefBrowserPlatformDelegate::PopupBrowserCreated(
|
||||
CefWindow::CreateTopLevelWindow(
|
||||
new PopupWindowDelegate(new_browser_view.get()));
|
||||
}
|
||||
|
||||
// Release the reference added in PopupWebContentsCreated().
|
||||
new_browser_view->Release();
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserViewDelegate>
|
||||
|
Reference in New Issue
Block a user