Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 339095: DeferredAutoreleasePool didn't work on Snow Leopard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_pump_mac.mm ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 30652)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -237,8 +237,16 @@
}
- (void)destroyBrowser {
+ [NSApp removeWindowsItem:[self window]];
+
// We need the window to go away now.
- [self close];
+ // We can't actually use |-autorelease| here because there's an embedded
+ // run loop in the |-performClose:| which contains its own autorelease pool.
+ // Instead we use call it after a zero-length delay, which gets us back
+ // to the main event loop.
+ [self performSelector:@selector(autorelease)
+ withObject:nil
+ afterDelay:0];
}
// Called when the window meets the criteria to be closed (ie,
@@ -254,7 +262,13 @@
// that its window has on our window before our window goes away.
delete statusBubble_;
statusBubble_ = NULL;
- [self autorelease];
+ // We can't actually use |-autorelease| here because there's an embedded
+ // run loop in the |-performClose:| which contains its own autorelease pool.
+ // Instead we call it after a zero-length delay, which gets us back
+ // to the main event loop.
+ [self performSelector:@selector(autorelease)
+ withObject:nil
+ afterDelay:0];
}
- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window {
« no previous file with comments | « base/message_pump_mac.mm ('k') | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698