Fix crash when closing an OSR browser (fixes issue #2919)

Release the Compositor before the WebContents is destroyed to match
the behavior in non-OSR code.
This commit is contained in:
Andrei Kurushin
2020-07-20 14:24:16 -04:00
committed by Marshall Greenblatt
parent 82d6bcbbea
commit 574d4dcedc
4 changed files with 66 additions and 26 deletions

View File

@@ -71,6 +71,20 @@ void CefBrowserPlatformDelegateOsr::BrowserCreated(
}
}
void CefBrowserPlatformDelegateOsr::NotifyBrowserDestroyed() {
content::WebContents* web_contents = browser_->web_contents();
content::RenderViewHost* host = web_contents->GetRenderViewHost();
if (host) {
CefRenderWidgetHostViewOSR* view =
static_cast<CefRenderWidgetHostViewOSR*>(host->GetWidget()->GetView());
if (view) {
view->ReleaseCompositor();
}
}
CefBrowserPlatformDelegateAlloy::NotifyBrowserDestroyed();
}
void CefBrowserPlatformDelegateOsr::BrowserDestroyed(
CefBrowserHostImpl* browser) {
CefBrowserPlatformDelegateAlloy::BrowserDestroyed(browser);