Reinstate the -finalize method to remove ourselves as observer.

I was confusing KVO with Notifications earlier, as the GC Programming Guide 
explicitly says one should not unregister notifications in a finalize method 
when using GC.
This commit is contained in:
André Berg
2010-03-30 15:20:29 +02:00
parent 156d67f1fb
commit 25b47bb34b
+6 -6
View File
@@ -158,15 +158,15 @@ contextMenuItemsForElement:(NSDictionary *)element
return [historyController valueForKeyPath:[@"repository.config." stringByAppendingString:config]];
}
// - (void) finalize
// {
// [historyController removeObserver:self forKeyPath:@"webCommit"];
// [super finalize];
// }
- (void) finalize
{
[historyController removeObserver:self forKeyPath:@"webCommit"];
[super finalize];
}
- (void) preferencesChanged
{
[[self script] callWebScriptMethod:@"enableFeatures" withArguments:nil];
[[self script] callWebScriptMethod:@"enableFeatures" withArguments:nil];
}
@end