From 0eb982a9721d94e32e13c718123ba1408a32ef13 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 23 Apr 2014 10:53:07 +0800 Subject: [PATCH] Make sure window object is destryed. --- atom/browser/api/atom_api_window.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 1aa67b93113d..e8ebb57f7579 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -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(); }