adium 4581:ac6d3e841a37: Rename our immutableCopy to copyImmutab...

commits at adium.im commits at adium.im
Sat Jan 28 23:59:33 UTC 2012


details:	http://hg.adium.im/adium/rev/ac6d3e841a37
revision:	4581:ac6d3e841a37
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sun Jan 29 00:58:47 2012 +0100

Rename our immutableCopy to copyImmutable, to avoid a lot of false positive analyzer warnings.
Subject: adium 4582:626cff7a42c6: Fix another bunch of leaks found by the static analyzer.

details:	http://hg.adium.im/adium/rev/626cff7a42c6
revision:	4582:626cff7a42c6
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sun Jan 29 00:59:22 2012 +0100

Fix another bunch of leaks found by the static analyzer.

diffs (169 lines):

diff -r d3b8bf1f2451 -r 626cff7a42c6 Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.h	Sun Jan 29 00:36:10 2012 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.h	Sun Jan 29 00:59:22 2012 +0100
@@ -15,5 +15,5 @@
  */
 
 @interface NSCharacterSet (AICharacterSetAdditions)
-- (NSCharacterSet *)immutableCopy;
+- (NSCharacterSet *)copyImmutable;
 @end
diff -r d3b8bf1f2451 -r 626cff7a42c6 Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.m	Sun Jan 29 00:59:22 2012 +0100
@@ -24,8 +24,10 @@
  * Shark sampling demonstrates this to be true as of OS X 10.4.5.
  *
  * However, -[NSMutableCharacterSet copy] returns a new NSMutableCharacterSet which remains inefficient!
+ *
+ * This is still true as of 10.7.2.
  */
-- (NSCharacterSet *)immutableCopy
+- (NSCharacterSet *)copyImmutable
 {
 	return [[NSCharacterSet characterSetWithBitmapRepresentation:[self bitmapRepresentation]] retain];
 }
diff -r d3b8bf1f2451 -r 626cff7a42c6 Plugins/Bonjour/libezv/Classes/AWEzvContact.m
--- a/Plugins/Bonjour/libezv/Classes/AWEzvContact.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Plugins/Bonjour/libezv/Classes/AWEzvContact.m	Sun Jan 29 00:59:22 2012 +0100
@@ -367,7 +367,7 @@
 	connection = [[NSFileHandle alloc] initWithFileDescriptor:fd];
 	
 	/* now to create stream */
-	self.stream = [[AWEzvXMLStream alloc] initWithFileHandle:connection initiator:1];
+	self.stream = [[[AWEzvXMLStream alloc] initWithFileHandle:connection initiator:1] autorelease];
 	[self.stream setDelegate:self];
 	[self.stream readAndParse];
 	
diff -r d3b8bf1f2451 -r 626cff7a42c6 Plugins/Dual Window Interface/AIMessageWindowController.m
--- a/Plugins/Dual Window Interface/AIMessageWindowController.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Plugins/Dual Window Interface/AIMessageWindowController.m	Sun Jan 29 00:59:22 2012 +0100
@@ -153,8 +153,9 @@
 
     [tabView_tabBar setDelegate:nil];
 
-	[self.containedChats release];
+	[m_containedChats release];
 	[toolbarItems release];
+	[toolbar release];
 	[containerName release];
 	[containerID release];
 
@@ -1315,7 +1316,7 @@
 - (void)_configureToolbar
 {
 //	NSToolbar *toolbar; change this if need be
-    toolbar = [[[NSToolbar alloc] initWithIdentifier:TOOLBAR_MESSAGE_WINDOW] autorelease];
+    toolbar = [[NSToolbar alloc] initWithIdentifier:TOOLBAR_MESSAGE_WINDOW];
 	
     [toolbar setDelegate:self];
     [toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
diff -r d3b8bf1f2451 -r 626cff7a42c6 Plugins/Purple Service/ESIRCService.m
--- a/Plugins/Purple Service/ESIRCService.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Plugins/Purple Service/ESIRCService.m	Sun Jan 29 00:59:22 2012 +0100
@@ -58,7 +58,7 @@
 	NSCharacterSet			*returnSet;
 	
 	[allowedCharacters addCharactersInString:@"[]\\`_^{|}-"];
-	returnSet = [allowedCharacters immutableCopy];
+	returnSet = [allowedCharacters copyImmutable];
 	[allowedCharacters release];
 
 	return [returnSet autorelease];
diff -r d3b8bf1f2451 -r 626cff7a42c6 Plugins/Purple Service/ESJabberService.m
--- a/Plugins/Purple Service/ESJabberService.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Plugins/Purple Service/ESJabberService.m	Sun Jan 29 00:59:22 2012 +0100
@@ -175,7 +175,7 @@
 		[allowedCharactersInNode addCharactersInRange:x10000_10FFFF];
 
 
-		charactersInNode = [allowedCharactersInNode immutableCopy];
+		charactersInNode = [allowedCharactersInNode copyImmutable];
 		[allowedCharactersInNode release];
 	}
 
@@ -212,7 +212,7 @@
 		[allowedCharactersInDomain addCharactersInRange:upperCaseLatters];
 		[allowedCharactersInDomain addCharactersInString:@"-."];
 
-		charactersInDomain = [allowedCharactersInDomain immutableCopy];
+		charactersInDomain = [allowedCharactersInDomain copyImmutable];
 		[allowedCharactersInDomain release];
 	}
 
@@ -252,7 +252,7 @@
 		[allowedCharactersInResource addCharactersInRange:xE000_FFFD];
 		[allowedCharactersInResource addCharactersInRange:x10000_10FFFF];
 
-		charactersInResource = [allowedCharactersInResource immutableCopy];
+		charactersInResource = [allowedCharactersInResource copyImmutable];
 		[allowedCharactersInResource release];
 	}
 
@@ -277,7 +277,7 @@
 	[allowedCharacters formUnionWithCharacterSet:nodeSet];
 	[allowedCharacters addCharactersInString:@"@"];
 	[allowedCharacters formUnionWithCharacterSet:domainSet];
-	returnSet = [allowedCharacters immutableCopy];
+	returnSet = [allowedCharacters copyImmutable];
 	[allowedCharacters release];
 
 	return [returnSet autorelease];
@@ -296,7 +296,7 @@
 
 	[allowedCharacters addCharactersInString:@"/"];
 	[allowedCharacters formUnionWithCharacterSet:resourceSet];
-	returnSet = [allowedCharacters immutableCopy];
+	returnSet = [allowedCharacters copyImmutable];
 	[allowedCharacters release];
 	
 	return [returnSet autorelease];
diff -r d3b8bf1f2451 -r 626cff7a42c6 Plugins/Purple Service/ESMeanwhileService.m
--- a/Plugins/Purple Service/ESMeanwhileService.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Plugins/Purple Service/ESMeanwhileService.m	Sun Jan 29 00:59:22 2012 +0100
@@ -60,7 +60,7 @@
 	[allowedCharacters formUnionWithCharacterSet:[NSCharacterSet symbolCharacterSet]];
 	[allowedCharacters addCharactersInString:@" "];
 
-	returnSet = [allowedCharacters immutableCopy];
+	returnSet = [allowedCharacters copyImmutable];
 	[allowedCharacters release];
 	
 	return [returnSet autorelease];
diff -r d3b8bf1f2451 -r 626cff7a42c6 Source/AIEmoticonController.m
--- a/Source/AIEmoticonController.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Source/AIEmoticonController.m	Sun Jan 29 00:59:22 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 immutableCopy] forKey:replacementString];
+					[endingSetDict setObject:[tempSet copyImmutable] forKey:replacementString];
 					[tempSet release];
 					endingTrimSet = [endingSetDict objectForKey:replacementString];
 				}
@@ -863,10 +863,10 @@
         }
     }
 
-	[_emoticonHintCharacterSet release]; _emoticonHintCharacterSet = [tmpEmoticonHintCharacterSet immutableCopy];
+	[_emoticonHintCharacterSet release]; _emoticonHintCharacterSet = [tmpEmoticonHintCharacterSet copyImmutable];
 	[tmpEmoticonHintCharacterSet release];
 
-    [_emoticonStartCharacterSet release]; _emoticonStartCharacterSet = [tmpEmoticonStartCharacterSet immutableCopy];
+    [_emoticonStartCharacterSet release]; _emoticonStartCharacterSet = [tmpEmoticonStartCharacterSet copyImmutable];
 	[tmpEmoticonStartCharacterSet release];
 
 	//After building all the subIndexes, sort them by length here
diff -r d3b8bf1f2451 -r 626cff7a42c6 Source/AIURLHandlerPlugin.m
--- a/Source/AIURLHandlerPlugin.m	Sun Jan 29 00:36:10 2012 +0100
+++ b/Source/AIURLHandlerPlugin.m	Sun Jan 29 00:59:22 2012 +0100
@@ -527,7 +527,7 @@
 	}
 	
 	if (!ircAccount) {
-		[[AITemporaryIRCAccountWindowController alloc] initWithChannel:name server:server port:port andPassword:password];
+		[[[AITemporaryIRCAccountWindowController alloc] initWithChannel:name server:server port:port andPassword:password] autorelease];
 	} else if (name) {
 		[adium.chatController chatWithName:name
 		 identifier:nil




More information about the commits mailing list