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:
@@ -35,6 +35,8 @@ class CefBrowserViewImpl
|
||||
CefBrowserViewImpl(const CefBrowserViewImpl&) = delete;
|
||||
CefBrowserViewImpl& operator=(const CefBrowserViewImpl&) = delete;
|
||||
|
||||
~CefBrowserViewImpl() override;
|
||||
|
||||
// Create a new CefBrowserView instance. |delegate| may be nullptr.
|
||||
// |window_info| will only be used when creating a Chrome child window.
|
||||
static CefRefPtr<CefBrowserViewImpl> Create(
|
||||
@@ -99,6 +101,10 @@ class CefBrowserViewImpl
|
||||
bool IsAlloyStyle() const { return is_alloy_style_; }
|
||||
bool IsChromeStyle() const { return !is_alloy_style_; }
|
||||
|
||||
base::WeakPtr<CefBrowserViewImpl> GetWeakPtr() {
|
||||
return weak_ptr_factory_.GetWeakPtr();
|
||||
}
|
||||
|
||||
private:
|
||||
// Create a new implementation object.
|
||||
// Always call Initialize() after creation.
|
||||
|
Reference in New Issue
Block a user