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:
@@ -5,6 +5,7 @@
|
||||
#ifndef CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_
|
||||
#define CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "cef/libcef/browser/alloy/browser_platform_delegate_alloy.h"
|
||||
#include "cef/libcef/browser/native/browser_platform_delegate_native.h"
|
||||
#include "cef/libcef/browser/views/browser_view_impl.h"
|
||||
@@ -65,7 +66,13 @@ class CefBrowserPlatformDelegateViews
|
||||
|
||||
private:
|
||||
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_;
|
||||
CefRefPtr<CefBrowserViewImpl> browser_view_;
|
||||
|
||||
// Holding a weak reference here because we want the CefBrowserViewImpl to be
|
||||
// destroyed first if all references are released by the client.
|
||||
// CefBrowserViewImpl destruction will then trigger destruction of any
|
||||
// associated CefBrowserHostBase (which owns this CefBrowserPlatformDelegate
|
||||
// object).
|
||||
base::WeakPtr<CefBrowserViewImpl> browser_view_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_BROWSER_PLATFORM_DELEGATE_VIEWS_H_
|
||||
|
Reference in New Issue
Block a user