Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory management issue #124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions INAppStoreWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ - (void)dealloc
[_minimizeButton release];
[_zoomButton release];
[_fullScreenButton release];
[_titleBarContainer release];
[super dealloc];
#endif
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 autorelease];
self.titleBarView = [[[INTitlebarView alloc] initWithFrame:NSZeroRect] autorelease];
#endif
}
Expand Down