Fix a crash when closing an off-screen browser with no references (issue #1121).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1500 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-10-29 22:19:51 +00:00
parent 81f3a75f6a
commit 78cfa155c6

View File

@ -1543,6 +1543,10 @@ void CefBrowserHostImpl::CloseContents(content::WebContents* source) {
// via the platform window destruction mechanism.
PlatformCloseWindow();
} else {
// Keep a reference to the browser while it's in the process of being
// destroyed.
CefRefPtr<CefBrowserHostImpl> browser(this);
// No window exists. Destroy the browser immediately.
DestroyBrowser();
if (!IsWindowRenderingDisabled()) {