Skip to content

Commit

Permalink
Remove WindowArrangements from NSNotificationCenter on dealloc, which…
Browse files Browse the repository at this point in the history
… crashes 10.10 and earlier when it posts kSavedArrangementDidChangeNotification when a dealloced instance is still observing notifications.
  • Loading branch information
gnachman committed Aug 6, 2016
1 parent 1f1b613 commit a70a6d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sources/WindowArrangements.m
Expand Up @@ -26,6 +26,11 @@ - (void)updateActionsEnabled
[defaultButton_ setEnabled:([WindowArrangements count] > 0) && ([tableView_ selectedRow] >= 0)];
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}

- (void)awakeFromNib
{
[self updateActionsEnabled];
Expand Down

0 comments on commit a70a6d2

Please sign in to comment.