Skip to content

Commit

Permalink
#311: convert a __weak pointer to __unsafe_unretained because Lio…
Browse files Browse the repository at this point in the history
…n can’t handle it
  • Loading branch information
rowanj committed May 16, 2014
1 parent b5487f9 commit 4ce6f02
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Classes/Controllers/PBGitHistoryController.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,12 @@ - (void)awakeFromNib
bottomColor:[NSColor colorWithCalibratedHue:0.579 saturation:0.119 brightness:0.765 alpha:1.000]];
[self updateBranchFilterMatrix];

// listen for updates
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_repositoryUpdatedNotification:) name:PBGitRepositoryEventNotification object:repository];

__weak PBGitHistoryController *weakSelf = self;
commitList.findPanelActionBlock = ^(id sender){
PBGitHistoryController *controller = weakSelf;
if (!controller) {
return;
}
[controller.view.window makeFirstResponder:controller->searchField];
// listen for updates
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_repositoryUpdatedNotification:) name:PBGitRepositoryEventNotification object:repository];

__unsafe_unretained PBGitHistoryController *weakSelf = self;
commitList.findPanelActionBlock = ^(id sender) {
[weakSelf.view.window makeFirstResponder:weakSelf->searchField];
};

[super awakeFromNib];
Expand Down

0 comments on commit 4ce6f02

Please sign in to comment.