From 6c413764311578d9698d2a2952950a9529e4a7ce Mon Sep 17 00:00:00 2001 From: Bogdan Popescu Date: Tue, 24 Sep 2013 05:00:35 +0300 Subject: [PATCH 1/2] Fix memory management issue --- INAppStoreWindow.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INAppStoreWindow.m b/INAppStoreWindow.m index f84010f..897bf34 100644 --- a/INAppStoreWindow.m +++ b/INAppStoreWindow.m @@ -967,7 +967,7 @@ - (void)_createTitlebarView _titleBarContainer = container; self.titleBarView = [[INTitlebarView alloc] initWithFrame:NSZeroRect]; #else - _titleBarContainer = [container autorelease]; + _titleBarContainer = container; self.titleBarView = [[[INTitlebarView alloc] initWithFrame:NSZeroRect] autorelease]; #endif } From 1a8a8875f10430982ee585a096b7384252d3f2f5 Mon Sep 17 00:00:00 2001 From: Bogdan Popescu Date: Sat, 5 Oct 2013 23:39:26 +0300 Subject: [PATCH 2/2] Re-add titleBarContainer when setStyleMask: causes the themeFrameView to change --- INAppStoreWindow.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/INAppStoreWindow.m b/INAppStoreWindow.m index 897bf34..f51fb39 100644 --- a/INAppStoreWindow.m +++ b/INAppStoreWindow.m @@ -453,6 +453,7 @@ - (void)dealloc [_minimizeButton release]; [_zoomButton release]; [_fullScreenButton release]; + [_titleBarContainer release]; [super dealloc]; #endif } @@ -721,6 +722,12 @@ - (void)setStyleMask:(NSUInteger)styleMask _preventWindowFrameChange = YES; [super setStyleMask:styleMask]; _preventWindowFrameChange = NO; + if(_titleBarContainer && [_titleBarContainer superview] != [self themeFrameView]) + { + NSView *firstSubview = [[[self themeFrameView] subviews] objectAtIndex:0]; + [self _recalculateFrameForTitleBarContainer]; + [[self themeFrameView] addSubview:_titleBarContainer positioned:NSWindowBelow relativeTo:firstSubview]; + } } - (void)setFrame:(NSRect)frameRect display:(BOOL)flag @@ -963,11 +970,10 @@ - (void)_createTitlebarView NSView *firstSubview = [[[self themeFrameView] subviews] objectAtIndex:0]; [self _recalculateFrameForTitleBarContainer]; [[self themeFrameView] addSubview:container positioned:NSWindowBelow relativeTo:firstSubview]; - #if __has_feature(objc_arc) _titleBarContainer = container; + #if __has_feature(objc_arc) self.titleBarView = [[INTitlebarView alloc] initWithFrame:NSZeroRect]; #else - _titleBarContainer = container; self.titleBarView = [[[INTitlebarView alloc] initWithFrame:NSZeroRect] autorelease]; #endif }