adium 4157:80d30fd0e0d8: Fixed the last retain-loop I found for ...

commits at adium.im commits at adium.im
Sun Aug 21 21:15:55 UTC 2011


details:	http://hg.adium.im/adium/rev/80d30fd0e0d8
revision:	4157:80d30fd0e0d8
branch:		(none)
author:		Evan Schoenberg
date:		Sun Aug 21 16:15:48 2011 -0500

Fixed the last retain-loop I found for AIChat; AIChat once more deallocates properly. Also, fixed behavior of removeAllParticipatingContactsSilently to work even if the chat isn't closing (though when we use it, it currently is... this is just less fragile).

diffs (34 lines):

diff -r db9fbeb2372e -r 80d30fd0e0d8 Frameworks/Adium Framework/Source/AIChat.m
--- a/Frameworks/Adium Framework/Source/AIChat.m	Sun Aug 21 15:50:25 2011 -0500
+++ b/Frameworks/Adium Framework/Source/AIChat.m	Sun Aug 21 16:15:48 2011 -0500
@@ -300,7 +300,7 @@
 - (void)setDisplayName:(NSString *)inDisplayName
 {
 	[[self displayArrayForKey:@"Display Name"] setObject:inDisplayName
-											   withOwner:self
+											   withOwner:[NSValue valueWithNonretainedObject:self] /* Don't want a retain loop */
 										   priorityLevel:Highest_Priority];
 
 	//The display array doesn't cause an attribute update; fake it.
@@ -724,6 +724,10 @@
 
 - (void)removeAllParticipatingContactsSilently
 {
+    [participatingContacts removeAllObjects];
+	[participatingContactsFlags removeAllObjects];
+	[participatingContactsAliases removeAllObjects];
+
 	for (AIListContact *listContact in self) {
 		if (listContact.isStranger &&
 			![adium.chatController existingChatWithContact:listContact.parentContact] &&
@@ -732,10 +736,6 @@
 		}
 	}
 
-	[participatingContacts removeAllObjects];
-	[participatingContactsFlags removeAllObjects];
-	[participatingContactsAliases removeAllObjects];
-
 	[[NSNotificationCenter defaultCenter] postNotificationName:Chat_ParticipatingListObjectsChanged
 											  object:self];
 }




More information about the commits mailing list