]> khamidou — GitHub mirrors - electron.git/commitdiff
Avoid destorying api::WebContents for twice
authorCheng Zhao <zcbenz@gmail.com>
Fri, 5 Jun 2015 10:13:30 +0000 (18:13 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 5 Jun 2015 10:13:30 +0000 (18:13 +0800)
atom/browser/api/atom_api_web_contents.cc

index 3678be78529bca6bb809828383d0c933f9f03f01..3d925b839918e82afc49a2884035b9212d9cb50f 100644 (file)
@@ -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();