diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 7403a7ecbb7..ede6bcd71e6 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -183,21 +183,21 @@ void Window::OnDevToolsFocus() { } void Window::OnDevToolsOpened() { - Emit("devtools-opened"); - v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); auto handle = WebContents::CreateFrom( isolate(), api_web_contents_->GetDevToolsWebContents()); devtools_web_contents_.Reset(isolate(), handle.ToV8()); + + Emit("devtools-opened"); } void Window::OnDevToolsClosed() { - Emit("devtools-closed"); - v8::Locker locker(isolate()); v8::HandleScope handle_scope(isolate()); devtools_web_contents_.Reset(); + + Emit("devtools-closed"); } void Window::OnExecuteWindowsCommand(const std::string& command_name) {