Skip to content

Commit

Permalink
Whack all the memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiennou committed Oct 21, 2019
1 parent 16d4135 commit bb8a516
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Classes/Controllers/PBGitCommitController.m
Expand Up @@ -135,6 +135,7 @@ - (void)closeView
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[webController closeView];
[super closeView];
}

- (NSResponder *)firstResponder;
Expand Down
5 changes: 5 additions & 0 deletions Classes/Controllers/PBGitSidebarController.m
Expand Up @@ -125,6 +125,11 @@ - (void)awakeFromNib
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandCollapseItem:) name:NSOutlineViewItemWillCollapseNotification object:sourceView];
}

- (void)closeView
{
[super closeView];
}

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSOutlineViewItemWillExpandNotification object:sourceView];
Expand Down
4 changes: 3 additions & 1 deletion Classes/Controllers/PBViewController.m
Expand Up @@ -35,7 +35,9 @@ - (void)closeView
{
[self unbind:@"repository"];
if (_hasViewLoaded)
[[self view] removeFromSuperview]; // remove the current view
[[self view] removeFromSuperview]; // remove the current view
repository = nil;
superController = nil;
}

- (void)awakeFromNib
Expand Down
2 changes: 1 addition & 1 deletion Classes/Views/PBSourceViewItem.h
Expand Up @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (getter=isUncollapsible) BOOL uncollapsible;
@property (getter=isExpanded) BOOL expanded;
@property PBGitRevSpecifier *revSpecifier;
@property PBSourceViewItem *parent;
@property (weak) PBSourceViewItem *parent;
@property (readonly) NSString *iconName;
@property (nullable, readonly) NSImage *icon;

Expand Down

0 comments on commit bb8a516

Please sign in to comment.