Bug 714132 - Retain mBackgroundColor in ToolbarWindow. r=smichaud
authorHub Figuière <hfiguiere@mozilla.com>
Wed, 04 Jan 2012 13:53:52 -0600
changeset 84983 0022f8be9feae8e2f706291719934617018fd8e7
parent 84982 0e8af7eb5f55a1b7fb824bb00f852fe4937d3694
child 84984 95b9cb1a8e2d023408a12d516d2be42fbf207adb
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs714132
milestone12.0a1
Bug 714132 - Retain mBackgroundColor in ToolbarWindow. r=smichaud
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -2310,17 +2310,17 @@ static const NSString* kStateShowsToolba
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   aStyle = aStyle | NSTexturedBackgroundWindowMask;
   if ((self = [super initWithContentRect:aContentRect styleMask:aStyle backing:aBufferingType defer:aFlag])) {
     mColor = [[TitlebarAndBackgroundColor alloc] initWithWindow:self];
     // Bypass our guard method below.
     [super setBackgroundColor:mColor];
-    mBackgroundColor = [NSColor whiteColor];
+    mBackgroundColor = [[NSColor whiteColor] retain];
 
     mUnifiedToolbarHeight = 0.0f;
 
     // setBottomCornerRounded: is a private API call, so we check to make sure
     // we respond to it just in case.
     if ([self respondsToSelector:@selector(setBottomCornerRounded:)])
       [self setBottomCornerRounded:NO];