Skip to content

Commit

Permalink
Fix a crash that happened when a tab was moved to its own window, clo…
Browse files Browse the repository at this point in the history
…sed, and the close was undone. I don't quite undersatnd why it was crashing, but there was a double release in redrawHighlight:. Making the tab bar control the userInfo seems to fix the problem. I'm guessing the timer got scheduled twice concurrently sometimes.
  • Loading branch information
gnachman committed Jul 30, 2015
1 parent 8a402b6 commit b38c33f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,17 @@ - (void)setHighlighted:(BOOL)highlighted {
[super setHighlighted:highlighted];
if (highlighted != wasHighlighted) {
_highlightChangeTime = [NSDate timeIntervalSinceReferenceDate];
[self.controlView retain];
[NSTimer scheduledTimerWithTimeInterval:1 / 60.0
target:self
selector:@selector(redrawHighlight:)
userInfo:nil
userInfo:self.controlView
repeats:YES];
}
}

- (void)redrawHighlight:(NSTimer *)timer {
[self.controlView setNeedsDisplayInRect:self.frame];
if ([NSDate timeIntervalSinceReferenceDate] - _highlightChangeTime > kHighlightAnimationDuration) {
[self.controlView release];
[timer invalidate];
}
}
Expand Down

0 comments on commit b38c33f

Please sign in to comment.