Skip to content

Commit 693a23d

Browse files
committed
Bugfix: don't remove all notifications from the web history controller
removeObserver: removes the controller from all notifications. The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences.
1 parent 1b3f4ea commit 693a23d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

PBWebHistoryController.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ - (void) changeContentTo: (PBGitCommit *) content
6767
NSFileHandle *handle = [repository handleForArguments:taskArguments];
6868
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
6969
// Remove notification, in case we have another one running
70-
[nc removeObserver:self];
70+
[nc removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil];
7171
[nc addObserver:self selector:@selector(commitDetailsLoaded:) name:NSFileHandleReadToEndOfFileCompletionNotification object:handle];
7272
[handle readToEndOfFileInBackgroundAndNotify];
7373
}
7474

7575
- (void)commitDetailsLoaded:(NSNotification *)notification
7676
{
77+
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleReadToEndOfFileCompletionNotification object:nil];
78+
7779
NSData *data = [[notification userInfo] valueForKey:NSFileHandleNotificationDataItem];
7880
if (!data)
7981
return;

0 commit comments

Comments
 (0)