]> khamidou — GitHub mirrors - electron.git/commitdiff
Make sure window object is destryed.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 02:53:07 +0000 (10:53 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 23 Apr 2014 02:53:07 +0000 (10:53 +0800)
atom/browser/api/atom_api_window.cc

index 1aa67b93113de2b9ab521635de23e7beb58b9c16..e8ebb57f75796d23b47a1bea9832d7e5df56f944 100644 (file)
@@ -11,7 +11,6 @@
 #include "atom/common/native_mate_converters/value_converter.h"
 #include "base/bind.h"
 #include "base/callback.h"
-#include "base/process/kill.h"
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/render_process_host.h"
@@ -74,6 +73,9 @@ Window::Window(base::DictionaryValue* options)
 }
 
 Window::~Window() {
+  if (window_)
+    Destroy();
+
   Emit("destroyed");
 }
 
@@ -137,7 +139,7 @@ mate::Wrappable* Window::New(mate::Arguments* args,
 }
 
 void Window::Destroy() {
-  base::KillProcess(window_->GetRenderProcessHandle(), 0, false);
+  window_->DestroyWebContents();
   window_->CloseImmediately();
 }