| Index: ui/base/cocoa/nib_loading.mm
|
| diff --git a/ui/base/cocoa/nib_loading.mm b/ui/base/cocoa/nib_loading.mm
|
| index dd0eb48d806e1454028ada1c2b738b131d6b61ae..6deea19f698b4006a023f41257f5d214e1b30a24 100644
|
| --- a/ui/base/cocoa/nib_loading.mm
|
| +++ b/ui/base/cocoa/nib_loading.mm
|
| @@ -7,6 +7,11 @@
|
| #include "base/mac/bundle_locations.h"
|
| #include "base/mac/scoped_nsobject.h"
|
|
|
| +@interface NSNib (MountainLionSDK)
|
| +- (BOOL)instantiateWithOwner:(nullable id)owner
|
| + topLevelObjects:(NSArray* __nonnull* __nullable)topLevelObjects;
|
| +@end
|
| +
|
| namespace ui {
|
|
|
| NSView* GetViewFromNib(NSString* name) {
|
| @@ -17,18 +22,10 @@ NSView* GetViewFromNib(NSString* name) {
|
| return nil;
|
|
|
| NSArray* objects;
|
| - BOOL success = [nib instantiateNibWithOwner:nil
|
| - topLevelObjects:&objects];
|
| + BOOL success = [nib instantiateWithOwner:nil topLevelObjects:&objects];
|
| if (!success)
|
| return nil;
|
|
|
| - // When loading a nib manually (as opposed to using an NSWindowController or
|
| - // NSViewController), all the top-level objects need to be explicitly
|
| - // released. See
|
| - // http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW10
|
| - // for more information.
|
| - [objects makeObjectsPerformSelector:@selector(release)];
|
| -
|
| // For some strange reason, even nibs that appear to have but one top-level
|
| // object often have more (an NSApplication, etc.). Filter out what isn't
|
| // desired.
|
|
|