adium 2289:ce81a0ced825: Avoid infinite looping if the offlineGr...

commits at adium.im commits at adium.im
Sat May 23 21:43:21 UTC 2009


details:	http://hg.adium.im/adium/rev/ce81a0ced825
revision:	2289:ce81a0ced825
author:		Zachary West <zacw at adium.im>
date:		Sat May 23 17:43:12 2009 -0400

Avoid infinite looping if the offlineGroup is called during updateListObject.

I can see a reason for using offlineGroup inside of -updateListObject:…:, but the act of creating the group there causes an infinite-loop of "create - update - create - update" in some situations. Delay the update until the next run loop.

diffstat:

 Source/AIContactController.m |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 21e40dfc3d7b -r ce81a0ced825 Source/AIContactController.m
--- a/Source/AIContactController.m	Sat May 23 17:10:19 2009 -0400
+++ b/Source/AIContactController.m	Sat May 23 17:43:12 2009 -0400
@@ -1401,7 +1401,8 @@
 		group = [[AIListGroup alloc] initWithUID:groupUID];
 		
 		//Add
-		[contactPropertiesObserverManager _updateAllAttributesOfObject:group];
+		//Update afterwards, in case it's being called inside updateListObject already.
+		[contactPropertiesObserverManager performSelector:@selector(_updateAllAttributesOfObject:) withObject:group afterDelay:0.0];
 		[groupDict setObject:group forKey:[groupUID lowercaseString]];
 		
 		//Add to the contact list


More information about the commits mailing list