summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 15:35:26 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-31 15:35:26 +0000
commit070131d12c5e5a9c29baa1d8ee28d5271a088a18 (patch)
treeccb34df6997427a41a6f8679ab3003bb28d7ae61 /chrome/browser/cocoa
parent9eb8f98b6f7582ce25ba8cac11827edb8a08a5eb (diff)
downloadchromium_src-070131d12c5e5a9c29baa1d8ee28d5271a088a18.zip
chromium_src-070131d12c5e5a9c29baa1d8ee28d5271a088a18.tar.gz
chromium_src-070131d12c5e5a9c29baa1d8ee28d5271a088a18.tar.bz2
DeferredAutoreleasePool didn't work on Snow Leopard.
This is a backout of r30647, but also resurrects the change from http://codereview.chromium.org/341022 to work around the crash that r30647 solved much more elegantly. We can't really leave things broken on 10.6, though. I killed most of a perfectly good Friday evening trying to figure out how to salvage r30647, but the DeferredAutoreleasePool approach seems doomed without making private calls. This makes me really sad. BUG=25857, 26399, 26402 TEST=Does it launch on Snow Leopard now? Does it crash when you close windows? Review URL: http://codereview.chromium.org/339095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm18
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 019f881..3c8df3b 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -237,8 +237,16 @@ willPositionSheet:(NSWindow*)sheet
}
- (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 @@ willPositionSheet:(NSWindow*)sheet
// 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 {