From: Cheng Zhao Date: Fri, 5 Jun 2015 10:13:30 +0000 (+0800) Subject: Avoid destorying api::WebContents for twice X-Git-Tag: v0.27.3~5^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=bb42c2c7b65b3f4fd5b0e796e48fde2a96eb6638;p=electron.git Avoid destorying api::WebContents for twice --- diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 3678be78..3d925b83 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -409,7 +409,7 @@ void WebContents::WillAttach(content::WebContents* embedder_web_contents, } void WebContents::Destroy() { - if (is_guest()) { + if (is_guest() && managed_web_contents()) { // When force destroying the "destroyed" event is not emitted. WebContentsDestroyed();