adium 4583:aa11115be326: Another bunch of leak fixes, found by t...

commits at adium.im commits at adium.im
Sun Jan 29 00:42:06 UTC 2012


details:	http://hg.adium.im/adium/rev/aa11115be326
revision:	4583:aa11115be326
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sun Jan 29 01:41:57 2012 +0100

Another bunch of leak fixes, found by the static analyzer.

diffs (147 lines):

diff -r 626cff7a42c6 -r aa11115be326 Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m
--- a/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m	Sun Jan 29 01:41:57 2012 +0100
@@ -295,7 +295,7 @@
 
 	// create the connection with the request
 	// and start loading the data
-	NSURLDownload *theDownload = [[NSURLDownload alloc] initWithRequest:theRequest delegate:self];
+	NSURLDownload *theDownload = [[[NSURLDownload alloc] initWithRequest:theRequest delegate:self] autorelease];
 	if (theDownload) {
 		[currentDownloads addObject:theDownload];
 		// set the destination file now
diff -r 626cff7a42c6 -r aa11115be326 Plugins/Twitter Plugin/AILaconicaAccount.m
--- a/Plugins/Twitter Plugin/AILaconicaAccount.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Plugins/Twitter Plugin/AILaconicaAccount.m	Sun Jan 29 01:41:57 2012 +0100
@@ -153,9 +153,9 @@
     NSString        *path = [[@"/" stringByAppendingPathComponent:self.apiPath]
                                    stringByAppendingPathComponent:@"statusnet/config.xml"];
     
-	NSURL           *url = [[NSURL alloc] initWithScheme:(self.useSSL ? @"https" : @"http")
-                                                    host:self.host
-                                                    path:path];
+	NSURL           *url = [[[NSURL alloc] initWithScheme:(self.useSSL ? @"https" : @"http")
+													 host:self.host
+													 path:path] autorelease];
     
     NSURLRequest    *configRequest = [NSURLRequest requestWithURL:url];
     
@@ -198,6 +198,7 @@
             AILogWithSignature(@"Failed fetching StatusNet server config for %@: %d %@", self.host, [err code], [err localizedDescription]);
 	
 		[configData release]; configData = nil;
+		[config release];
 		[textLimitConfigDownload release]; textLimitConfigDownload = nil;
     }
 }
diff -r 626cff7a42c6 -r aa11115be326 Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m	Sun Jan 29 01:41:57 2012 +0100
@@ -308,7 +308,7 @@
 	if (![[adium.preferenceController preferenceForKey:@"Adium 1.4:Updated Preferences"
 												 group:PREF_GROUP_WEBKIT_REGULAR_MESSAGE_DISPLAY] boolValue]) {
 		NSDictionary		*dict = [adium.preferenceController preferencesForGroup:PREF_GROUP_WEBKIT_REGULAR_MESSAGE_DISPLAY];
-		NSMutableDictionary *newDict = [dict mutableCopy];
+		NSMutableDictionary *newDict = [[dict mutableCopy] autorelease];
 		NSMutableSet		*keysToRemove = [NSMutableSet set];
 	
 		NSDictionary *conversionDict = 
diff -r 626cff7a42c6 -r aa11115be326 Source/AIDockIconSelectionSheet.m
--- a/Source/AIDockIconSelectionSheet.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/AIDockIconSelectionSheet.m	Sun Jan 29 01:41:57 2012 +0100
@@ -119,7 +119,7 @@
 - (void)xtrasChanged:(NSNotification *)notification
 {
 	if (!notification || [[notification object] caseInsensitiveCompare:@"AdiumIcon"] == NSOrderedSame) {
-		[self setIconsData:[[NSMutableArray alloc] init]];
+		[self setIconsData:[NSMutableArray array]];
 		NSMutableArray *dockIcons = [[NSMutableArray alloc] init];
 		
 		// Fetch the pack previews
diff -r 626cff7a42c6 -r aa11115be326 Source/AIEmoticonController.m
--- a/Source/AIEmoticonController.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/AIEmoticonController.m	Sun Jan 29 01:41:57 2012 +0100
@@ -292,7 +292,7 @@
 					[tempSet formUnionWithCharacterSet:[NSCharacterSet symbolCharacterSet]];
 					//remove any characters *in* the replacement string from the trimming set
 					[tempSet removeCharactersInString:replacementString];
-					[endingSetDict setObject:[tempSet copyImmutable] forKey:replacementString];
+					[endingSetDict setObject:[[tempSet copyImmutable] autorelease] forKey:replacementString];
 					[tempSet release];
 					endingTrimSet = [endingSetDict objectForKey:replacementString];
 				}
diff -r 626cff7a42c6 -r aa11115be326 Source/AIXMLChatlogConverter.m
--- a/Source/AIXMLChatlogConverter.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/AIXMLChatlogConverter.m	Sun Jan 29 01:41:57 2012 +0100
@@ -192,7 +192,7 @@
     for (AIAccount *account in adium.accountController.accounts) {
         if ([[account.UID compactedString] isEqualToString:[mySN compactedString]] &&
             [account.service.serviceID isEqualToString:service]) {
-            myDisplayName = [account.displayName retain];
+            myDisplayName = [[account.displayName retain] autorelease];
             break;
         }
     }    
diff -r 626cff7a42c6 -r aa11115be326 Source/BGEmoticonMenuPlugin.m
--- a/Source/BGEmoticonMenuPlugin.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/BGEmoticonMenuPlugin.m	Sun Jan 29 01:41:57 2012 +0100
@@ -158,15 +158,15 @@
 	//Register our toolbar item
 	button = [[[MVMenuButton alloc] initWithFrame:NSMakeRect(0,0,32,32)] autorelease];
 	[button setImage:[NSImage imageNamed:@"emoticon32" forClass:[self class] loadLazily:YES]];
-	toolbarItem = [[AIToolbarUtilities toolbarItemWithIdentifier:TOOLBAR_EMOTICON_IDENTIFIER
-														   label:TITLE_EMOTICON
-													paletteLabel:TITLE_INSERT_EMOTICON
-														 toolTip:TOOLTIP_INSERT_EMOTICON
-														  target:self
-												 settingSelector:@selector(setView:)
-													 itemContent:button
-														  action:@selector(insertEmoticon:)
-															menu:nil] retain];
+	toolbarItem = [AIToolbarUtilities toolbarItemWithIdentifier:TOOLBAR_EMOTICON_IDENTIFIER
+														  label:TITLE_EMOTICON
+												   paletteLabel:TITLE_INSERT_EMOTICON
+														toolTip:TOOLTIP_INSERT_EMOTICON
+														 target:self
+												settingSelector:@selector(setView:)
+													itemContent:button
+														 action:@selector(insertEmoticon:)
+														   menu:nil];
 	[toolbarItem setMinSize:NSMakeSize(32,32)];
 	[toolbarItem setMaxSize:NSMakeSize(32,32)];
 	[button setToolbarItem:toolbarItem];
diff -r 626cff7a42c6 -r aa11115be326 Source/ESAddressBookIntegrationAdvancedPreferences.m
--- a/Source/ESAddressBookIntegrationAdvancedPreferences.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/ESAddressBookIntegrationAdvancedPreferences.m	Sun Jan 29 01:41:57 2012 +0100
@@ -420,7 +420,7 @@
 			}
 		}
 		
-		[tokens addObject:[[string substringWithRange:NSMakeRange(start, i - start)] mutableCopy]];
+		[tokens addObject:[[[string substringWithRange:NSMakeRange(start, i - start)] mutableCopy] autorelease]];
 	}
 	
 	return tokens;
diff -r 626cff7a42c6 -r aa11115be326 Source/ESGlobalEventsPreferences.m
--- a/Source/ESGlobalEventsPreferences.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/ESGlobalEventsPreferences.m	Sun Jan 29 01:41:57 2012 +0100
@@ -766,6 +766,7 @@
 								   representedObject:soundSet];
 		
 		if ([[menuItem title] isEqualToString:NONE]) {
+			[noneMenuItem release];
 			noneMenuItem = menuItem;
 
 		} else {
diff -r 626cff7a42c6 -r aa11115be326 Source/XtrasInstaller.m
--- a/Source/XtrasInstaller.m	Sun Jan 29 00:59:22 2012 +0100
+++ b/Source/XtrasInstaller.m	Sun Jan 29 01:41:57 2012 +0100
@@ -103,7 +103,7 @@
 		AILogWithSignature(@"Downloading %@", urlToDownload);
 		NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:urlToDownload];
 		[request setHTTPShouldHandleCookies:NO];
-		self.download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
+		self.download = [[[NSURLDownload alloc] initWithRequest:request delegate:self] autorelease];
 //		[download setDestination:dest allowOverwrite:YES];
 
 		[urlToDownload release];




More information about the commits mailing list