Bug 1348424 - Drop the window's reference to mColor before releasing it. r=spohl a=gchang
authorMarkus Stange <mstange@themasta.com>
Fri, 07 Apr 2017 18:07:50 -0400
changeset 396028 8619db383886e1237486792ff33d5eb331cdec7d
parent 396027 db1d45543c1b1b8585c7f907a91dccf2201223a8
child 396029 c71323755db2d14dacee7c274ef0160aaf5124da
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, gchang
bugs1348424
milestone54.0
Bug 1348424 - Drop the window's reference to mColor before releasing it. r=spohl a=gchang MozReview-Commit-ID: LwRZwLpFUtD
widget/cocoa/nsCocoaWindow.h
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -181,19 +181,19 @@ typedef struct _nsCocoaWindowList {
 
 - (id)initWithWindow:(ToolbarWindow*)aWindow;
 
 @end
 
 // NSWindow subclass for handling windows with toolbars.
 @interface ToolbarWindow : BaseWindow
 {
-  TitlebarAndBackgroundColor *mColor;
+  TitlebarAndBackgroundColor *mColor; // strong
   CGFloat mUnifiedToolbarHeight;
-  NSColor *mBackgroundColor;
+  NSColor *mBackgroundColor; // strong
   NSView *mTitlebarView; // strong
   NSRect mWindowButtonsRect;
   NSRect mFullScreenButtonRect;
 }
 // Pass nil here to get the default appearance.
 - (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
 - (void)setUnifiedToolbarHeight:(CGFloat)aHeight;
 - (CGFloat)unifiedToolbarHeight;
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -3381,16 +3381,17 @@ static const NSString* kStateCollectionB
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (void)dealloc
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
+  [super setBackgroundColor:[NSColor whiteColor]];
   [mColor release];
   [mBackgroundColor release];
   [mTitlebarView release];
   [super dealloc];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }