adium 2235:09872cb3bbf7: Burninate *myUsersOfGlobalPrefs.

commits at adium.im commits at adium.im
Mon May 18 00:35:35 UTC 2009


details:	http://hg.adium.im/adium/rev/09872cb3bbf7
revision:	2235:09872cb3bbf7
author:		Zachary West <zacw at adium.im>
date:		Sun May 17 20:34:49 2009 -0400

Burninate *myUsersOfGlobalPrefs.

If we re-institute it, it's worth nothing that the issue *might* have been *myUsersOfGlobalPrefs not being incremented if a save is already about to occur, but that's just a passing observation as I burninate!! WITH FIRE.

diffstat:

 Source/AIPreferenceContainer.m |  12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diffs (67 lines):

diff -r 98bf3a79f9dd -r 09872cb3bbf7 Source/AIPreferenceContainer.m
--- a/Source/AIPreferenceContainer.m	Sun May 17 17:28:49 2009 -0700
+++ b/Source/AIPreferenceContainer.m	Sun May 17 20:34:49 2009 -0400
@@ -32,11 +32,9 @@
 #endif
 
 static NSMutableDictionary	*objectPrefs = nil;
-static NSInteger			usersOfObjectPrefs = 0;
 static NSTimer				*timer_savingOfObjectCache = nil;
 
 static NSMutableDictionary	*accountPrefs = nil;
-static NSInteger			usersOfAccountPrefs = 0;
 static NSTimer				*timer_savingOfAccountCache = nil;
 	
 /*!
@@ -97,13 +95,11 @@
 		if (object) {
 			if ([object isKindOfClass:[AIAccount class]]) {
 				myGlobalPrefs = &accountPrefs;
-				myUsersOfGlobalPrefs = &usersOfAccountPrefs;
 				myTimerForSavingGlobalPrefs = &timer_savingOfAccountCache;
 				globalPrefsName = @"AccountPrefs";
 				
 			} else {
 				myGlobalPrefs = &objectPrefs;
-				myUsersOfGlobalPrefs = &usersOfObjectPrefs;
 				myTimerForSavingGlobalPrefs = &timer_savingOfObjectCache;
 				globalPrefsName = @"ByObjectPrefs";
 			}
@@ -216,7 +212,6 @@
 		prefs = [[NSMutableDictionary alloc] init];
 		[*myGlobalPrefs setObject:prefs
 						   forKey:globalPrefsKey];
-		(*myUsersOfGlobalPrefs)++;
 	}
 	[self.prefs setValue:value forKey:key];
 }
@@ -236,8 +231,6 @@
 			//For compatibility with having loaded individual object prefs from previous version of Adium, we key by the safe filename string
 			NSString *globalPrefsKey = [object.internalObjectID safeFilenameString];
 			prefs = [[*myGlobalPrefs objectForKey:globalPrefsKey] retain];
-			if (prefs)
-				(*myUsersOfGlobalPrefs)++;
 
 		} else {
 			prefs = [[NSMutableDictionary dictionaryAtPath:userDirectory
@@ -393,7 +386,6 @@
 	} else if (inTimer == timer_savingOfAccountCache) {
 			[timer_savingOfAccountCache release]; timer_savingOfAccountCache = nil;
 	}
-	(*myUsersOfGlobalPrefs)--;
 }
 
 /*!
@@ -406,11 +398,9 @@
 		if (*myTimerForSavingGlobalPrefs) {
 				[*myTimerForSavingGlobalPrefs setFireDate:[NSDate dateWithTimeIntervalSinceNow:SAVE_OBJECT_PREFS_DELAY]];
 		} else {
-				(*myUsersOfGlobalPrefs)++;
 				
 #ifdef PREFERENCE_CONTAINER_DEBUG
-			// This shouldn't happen now that *myUsersOfGlobalPrefs is synchronized.
-			// Let's just log it for now.
+			// This shouldn't be happening at all.
 			if (!*myGlobalPrefs) {
 				NSLog(@"Attempted to detach to save for %@ [%@], but info was nil.", self, globalPrefsName);
 				AILogWithSignature(@"Attempted to detach to save for %@ [%@], but info was nil.", self, globalPrefsName);




More information about the commits mailing list