adium 2992:45e9c1be48de: Fix a leak of an NSArray in AITwitterAc...

commits at adium.im commits at adium.im
Mon Nov 30 19:17:02 UTC 2009


details:	http://hg.adium.im/adium/rev/45e9c1be48de
revision:	2992:45e9c1be48de
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 08:45:04 2009 -0800

Fix a leak of an NSArray in AITwitterAccount. Found by the analyzer.
Subject: adium 2993:28c8424c38d3: Fix a leak of an AISpecialPasswordPromptController. Found by the analyzer.

details:	http://hg.adium.im/adium/rev/28c8424c38d3
revision:	2993:28c8424c38d3
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 08:46:31 2009 -0800

Fix a leak of an AISpecialPasswordPromptController. Found by the analyzer.
Subject: adium 2994:76b37fdc0d8a: Fix a leak of an AIImageUploaderWindowController on every image upload. Found by the analyzer.

details:	http://hg.adium.im/adium/rev/76b37fdc0d8a
revision:	2994:76b37fdc0d8a
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 09:03:50 2009 -0800

Fix a leak of an AIImageUploaderWindowController on every image upload. Found by the analyzer.
Subject: adium 2995:ae44ab326242: Fixed a couple of analyzer flags: These assignments were unused.

details:	http://hg.adium.im/adium/rev/ae44ab326242
revision:	2995:ae44ab326242
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 09:14:02 2009 -0800

Fixed a couple of analyzer flags: These assignments were unused.

Part of the fix was adding some simple error handling, in the form of an AILog statement when timelineBookmark remains nil.
Subject: adium 2996:b072f8dfe753: Digitally restored what appear to be missing break statements, fixing a couple of analyzer flags and probably import of Invisible statuses from Fire.

details:	http://hg.adium.im/adium/rev/b072f8dfe753
revision:	2996:b072f8dfe753
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 09:16:14 2009 -0800

Digitally restored what appear to be missing break statements, fixing a couple of analyzer flags and probably import of Invisible statuses from Fire.
Subject: adium 2997:d5667a09769a: Use the updated variable to change the selected range. Fixes an analyzer flag.

details:	http://hg.adium.im/adium/rev/d5667a09769a
revision:	2997:d5667a09769a
author:		Peter Hosey <hg at boredzo.org>
date:		Mon Nov 30 09:27:27 2009 -0800

Use the updated variable to change the selected range. Fixes an analyzer flag.

diffs (106 lines):

diff -r 5bb8f2ba3e62 -r d5667a09769a Plugins/Image Uploading Plugin/AIImageUploaderWindowController.m
--- a/Plugins/Image Uploading Plugin/AIImageUploaderWindowController.m	Sun Nov 29 21:41:16 2009 -0600
+++ b/Plugins/Image Uploading Plugin/AIImageUploaderWindowController.m	Mon Nov 30 09:27:27 2009 -0800
@@ -23,9 +23,9 @@
 					 delegate:(id)inDelegate
 						 chat:(AIChat *)inChat
 {
-	AIImageUploaderWindowController *newController = [[self alloc] initWithWindowNibName:@"ImageUploaderProgress"
+	AIImageUploaderWindowController *newController = [[[self alloc] initWithWindowNibName:@"ImageUploaderProgress"
 																				delegate:inDelegate
-																					chat:inChat];
+																					chat:inChat] autorelease];
 
 	[NSApp beginSheet:newController.window
 	   modalForWindow:window
diff -r 5bb8f2ba3e62 -r d5667a09769a Plugins/Twitter Plugin/AITwitterAccount.m
--- a/Plugins/Twitter Plugin/AITwitterAccount.m	Sun Nov 29 21:41:16 2009 -0600
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m	Mon Nov 30 09:27:27 2009 -0800
@@ -200,11 +200,11 @@
 	[self setLastDisconnectionError:nil];
 	
 	// Creating the fake timeline account.
-	AIListBookmark *timelineBookmark = nil;
+	AIListBookmark *timelineBookmark = [adium.contactController existingBookmarkForChatName:self.timelineChatName
+																				  onAccount:self
+																		   chatCreationInfo:nil];
 	
-	if(!(timelineBookmark = [adium.contactController existingBookmarkForChatName:self.timelineChatName
-																	   onAccount:self
-																chatCreationInfo:nil])) {
+	if(!timelineBookmark) {
 		AIChat *newTimelineChat = [adium.chatController chatWithName:self.timelineChatName
 														  identifier:nil
 														   onAccount:self 
@@ -214,6 +214,10 @@
 		
 		timelineBookmark = [adium.contactController bookmarkForChat:newTimelineChat inGroup:[adium.contactController groupWithUID:TWITTER_REMOTE_GROUP_NAME]];
 
+
+		if(!timelineBookmark) {
+			AILog(@"%@ Timeline bookmark is nil! Tried checking for existing bookmark for chat name %@, and creating a bookmark for chat %@ in group %@", self.timelineChatName, newTimelineChat, [adium.contactController groupWithUID:TWITTER_REMOTE_GROUP_NAME]);
+		}
 	}
 	
 	NSTimeInterval updateInterval = [[self preferenceForKey:TWITTER_PREFERENCE_UPDATE_INTERVAL group:TWITTER_PREFERENCE_GROUP_UPDATES] integerValue] * 60;
@@ -2051,7 +2055,7 @@
 	} else if ([self requestTypeForRequestID:identifier] == AITwitterProfileStatusUpdates) {
 		AIListContact *listContact = [[self dictionaryForRequestID:identifier] objectForKey:@"ListContact"];
 
-		NSMutableArray *profileArray = [[listContact profileArray] mutableCopy];
+		NSMutableArray *profileArray = [[[listContact profileArray] mutableCopy] autorelease];
 		
 		AILogWithSignature(@"%@ Updating statuses for profile, user %@", self, listContact);
 		
diff -r 5bb8f2ba3e62 -r d5667a09769a Source/AISpecialPasswordPromptController.m
--- a/Source/AISpecialPasswordPromptController.m	Sun Nov 29 21:41:16 2009 -0600
+++ b/Source/AISpecialPasswordPromptController.m	Mon Nov 30 09:27:27 2009 -0800
@@ -56,14 +56,14 @@
 		[controller setTarget:inTarget selector:inSelector context:inContext];
 		
 	} else {
-		if ((controller = [[self alloc] initWithWindowNibName:SPECIAL_ACCOUNT_PASSWORD_PROMPT 
+		if ((controller = [[[self alloc] initWithWindowNibName:SPECIAL_ACCOUNT_PASSWORD_PROMPT 
 												   forAccount:inAccount 
 														 type:inType
 														 name:inName
 													 password:inPassword
 											  notifyingTarget:inTarget
 													 selector:inSelector
-													  context:inContext])) {
+													  context:inContext] autorelease])) {
 			[passwordPromptControllerDict setObject:controller
 											 forKey:identifier];
 		}	
diff -r 5bb8f2ba3e62 -r d5667a09769a Source/AIURLShortenerPlugin.m
--- a/Source/AIURLShortenerPlugin.m	Sun Nov 29 21:41:16 2009 -0600
+++ b/Source/AIURLShortenerPlugin.m	Mon Nov 30 09:27:27 2009 -0800
@@ -192,8 +192,8 @@
 	
 	if (unknownLinkURL) {
 		//If a link exists at our selection, expand the selection to encompass that entire link
-		[textView setSelectedRange:rangeOfLinkAttribute];
 		selectedRange = rangeOfLinkAttribute;
+		[textView setSelectedRange:selectedRange];
 
 		if([unknownLinkURL isKindOfClass:[NSURL class]]) {
 			linkURL = [(NSURL *)unknownLinkURL absoluteString];
diff -r 5bb8f2ba3e62 -r d5667a09769a Source/GBFireImporter.m
--- a/Source/GBFireImporter.m	Sun Nov 29 21:41:16 2009 -0600
+++ b/Source/GBFireImporter.m	Mon Nov 30 09:27:27 2009 -0800
@@ -342,6 +342,7 @@
 				break;
 			case 4:
 				adiumType = AIInvisibleStatusType;
+				break;
 			case 3:
 			case 2:
 			default:
@@ -597,6 +598,7 @@
 				break;
 			case 4:
 				adiumType = AIInvisibleStatusType;
+				break;
 			case 3:
 			case 2:
 			default:




More information about the commits mailing list