projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c6d232
)
Destroy the native window in next tick
author
Cheng Zhao
<zcbenz@gmail.com>
Fri, 4 Dec 2015 03:35:04 +0000
(11:35 +0800)
committer
Cheng Zhao
<zcbenz@gmail.com>
Fri, 4 Dec 2015 03:35:04 +0000
(11:35 +0800)
It fixes a possible crash when native code is iterating all windows
while the JavaScript code decides to destroy a window.
atom/browser/api/atom_api_window.cc
patch
|
blob
|
history
diff --git
a/atom/browser/api/atom_api_window.cc
b/atom/browser/api/atom_api_window.cc
index
79c91db
..
84e5c53
100644
(file)
--- a/
atom/browser/api/atom_api_window.cc
+++ b/
atom/browser/api/atom_api_window.cc
@@
-159,6
+159,10
@@
Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
Window::~Window() {
if (!window_->IsClosed())
window_->CloseContents(nullptr);
+
+ // Destroy the native window in next tick because the native code might be
+ // iterating all windows.
+ base::MessageLoop::current()->DeleteSoon(FROM_HERE, window_.release());
}
void Window::WillCloseWindow(bool* prevent_default) {