Skip to content

Commit

Permalink
Merge pull request #9 from thibaut-jarosz/master
Browse files Browse the repository at this point in the history
Fixing Arc crash
  • Loading branch information
indragiek committed Feb 27, 2013
2 parents ab3ebe2 + b16c9d0 commit 22ce1b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion INPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ - (void)_closePopoverAndResetVariables
[self _setArrowDirection:INPopoverArrowDirectionUndefined];
[self _setPositionView:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[_popoverWindow animationForKey:@"alphaValue"] setDelegate:nil]; // reset delegate so it doesn't retain us
_screenRect = NSZeroRect;
_viewRect = NSZeroRect;

// When using ARC and no animation, there is a "message sent to deallocated instance" crash if setDelegate: is not performed at the end of the event.
[[_popoverWindow animationForKey:@"alphaValue"] performSelector:@selector(setDelegate:) withObject:nil afterDelay:0];
}

- (void)_callDelegateMethod:(SEL)selector
Expand Down

0 comments on commit 22ce1b9

Please sign in to comment.