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

Unified Diff: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm

Issue 582103002: mac: Fix Yosemite crash while attempting to open multiple files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
index 7d483ce68506341f57b6e2ab45576bd08c9bf50b..0bfdbba222e6e2656b64399908e2285b14661aef 100644
--- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
+++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
@@ -5,6 +5,7 @@
#import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h"
#include "apps/app_shim/extension_app_shim_handler_mac.h"
+#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
@@ -277,6 +278,13 @@ void AddDuplicateItem(NSMenuItem* top_level_item,
}
- (void)windowMainStatusChanged:(NSNotification*)notification {
+ // A Yosemite AppKit bug causes this notification to be sent during the
+ // -dealloc for a specific NSWindow. Any autoreleases sent to that window
+ // must be drained before the window finishes -dealloc. In this method, an
+ // autorelease is sent by the invocation of [NSApp windows].
+ // http://crbug.com/406944.
+ base::mac::ScopedNSAutoreleasePool pool;
+
id window = [notification object];
NSString* name = [notification name];
if ([name isEqualToString:NSWindowDidBecomeMainNotification]) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698