From 25b47bb34bb4eff5f616a6f8e1e3d65247beb70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Berg?= Date: Tue, 30 Mar 2010 15:20:29 +0200 Subject: [PATCH] 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. --- PBWebHistoryController.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 21dd55a..af661eb 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -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