views: Fix dangling raw_ptr on CefToolbarViewView destruction

This commit is contained in:
Marshall Greenblatt 2024-10-15 15:43:02 -04:00
parent f1e634393f
commit efe558cd28
2 changed files with 8 additions and 0 deletions

View File

@ -11,6 +11,13 @@ ChromeBrowserView::ChromeBrowserView(CefBrowserViewImpl* cef_browser_view)
: ParentClass(cef_browser_view->delegate()), : ParentClass(cef_browser_view->delegate()),
cef_browser_view_(cef_browser_view) {} cef_browser_view_(cef_browser_view) {}
ChromeBrowserView::~ChromeBrowserView() {
if (cef_toolbar_) {
WillDestroyToolbar();
cef_toolbar_ = nullptr;
}
}
void ChromeBrowserView::InitBrowser(std::unique_ptr<Browser> browser) { void ChromeBrowserView::InitBrowser(std::unique_ptr<Browser> browser) {
DCHECK(!web_view_); DCHECK(!web_view_);

View File

@ -30,6 +30,7 @@ class ChromeBrowserView
// |cef_browser_view| is non-nullptr and will outlive this object. // |cef_browser_view| is non-nullptr and will outlive this object.
explicit ChromeBrowserView(CefBrowserViewImpl* cef_browser_view); explicit ChromeBrowserView(CefBrowserViewImpl* cef_browser_view);
~ChromeBrowserView() override;
ChromeBrowserView(const ChromeBrowserView&) = delete; ChromeBrowserView(const ChromeBrowserView&) = delete;
ChromeBrowserView& operator=(const ChromeBrowserView&) = delete; ChromeBrowserView& operator=(const ChromeBrowserView&) = delete;