fix: NSWindow crash happening on macos 10.9 (#15670)

This commit is contained in:
trop[bot]
2018-11-10 11:19:34 -08:00
committed by Shelley Vohr
parent 2d0b80cf57
commit 64874660e1

View File

@@ -517,6 +517,11 @@ void NativeWindowMac::Close() {
}
void NativeWindowMac::CloseImmediately() {
// Retain the child window before closing it. If the last reference to the
// NSWindow goes away inside -[NSWindow close], then bad stuff can happen.
// See e.g. http://crbug.com/616701.
base::scoped_nsobject<NSWindow> child_window(window_,
base::scoped_policy::RETAIN);
[window_ close];
}