Revision: 5575
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5575&view=rev
Author:   hofman
Date:     2009-08-22 10:10:35 +0000 (Sat, 22 Aug 2009)

Log Message:
-----------
Don't remove SUUpdater as KVO observer, because the ones that are observing are 
singletons and are never deallocated, while temporary instances cannot remove 
themselves as observer because they're not registered.

Modified Paths:
--------------
    trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m

Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m   2009-08-21 07:57:30 UTC 
(rev 5574)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m   2009-08-22 10:10:35 UTC 
(rev 5575)
@@ -23,7 +23,6 @@
 - (BOOL)automaticallyDownloadsUpdates;
 - (void)scheduleNextUpdateCheck;
 - (void)registerAsObserver;
-- (void)unregisterAsObserver;
 - (void)updateDriverDidFinish:(NSNotification *)note;
 - initForBundle:(NSBundle *)bundle;
 - (NSURL *)parameterizedFeedURL;
@@ -214,18 +213,6 @@
     [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self 
forKeyPath:[@"values." stringByAppendingString:SUEnableAutomaticChecksKey] 
options:0 context:SUUpdaterDefaultsObservationContext];
 }
 
-- (void)unregisterAsObserver
-{
-       [[NSNotificationCenter defaultCenter] removeObserver:self];
-    // Removing self as a KVO observer if no observer was registered leads to 
an NSException. But we don't care.
-       @try
-       {
-               [[NSUserDefaultsController sharedUserDefaultsController] 
removeObserver:self forKeyPath:[@"values." 
stringByAppendingString:SUScheduledCheckIntervalKey]];
-               [[NSUserDefaultsController sharedUserDefaultsController] 
removeObserver:self forKeyPath:[@"values." 
stringByAppendingString:SUEnableAutomaticChecksKey]];
-       }
-       @catch (NSException *e) { }
-}
-
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 
change:(NSDictionary *)change context:(void *)context
 {
        if (context == SUUpdaterDefaultsObservationContext)
@@ -370,7 +357,7 @@
 
 - (void)dealloc
 {
-       [self unregisterAsObserver];
+       [[NSNotificationCenter defaultCenter] removeObserver:self];
        [host release];
        if (checkTimer)
        {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to