mac: Do not destroy window immediately.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 7 Apr 2014 09:19:27 +0000 (17:19 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 7 Apr 2014 09:20:08 +0000 (17:20 +0800)
Fixes atom/atom#1841.

atom/browser/native_window_mac.mm

index 8ee1276..2a779dd 100644 (file)
@@ -199,7 +199,8 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
 
 NativeWindowMac::~NativeWindowMac() {
   if (window())
-    [window() release];
+    // Use autorelease since we may have delegates or observers at this time.
+    [window() autorelease];
 }
 
 void NativeWindowMac::Close() {