adium 4188:7c3822c44c0f: Don't attempt to reuse the AIProxyListO...

commits at adium.im commits at adium.im
Tue Aug 30 00:43:04 UTC 2011


details:	http://hg.adium.im/adium/rev/7c3822c44c0f
revision:	4188:7c3822c44c0f
branch:		(none)
author:		Evan Schoenberg
date:		Mon Aug 29 19:43:00 2011 -0500

Don't attempt to reuse the AIProxyListObject associated with a leaked ESObjectWithProperties; discard further use of it, clear its cache, and make a new one. Fixes #14294. Thanks to '''kbotc''' for the solution.

diffs (58 lines):

diff -r 03b0a921bb0f -r 7c3822c44c0f Frameworks/Adium Framework/Source/AIProxyListObject.m
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.m	Sun Aug 28 21:08:25 2011 -0500
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.m	Mon Aug 29 19:43:00 2011 -0500
@@ -61,15 +61,11 @@
 
 	if (proxy && proxy.listObject != inListObject) {
         /* This is generally a memory management failure; AIContactController stopped tracking a list object, but it never deallocated and
-		 * so never called [AIProxyListObject releaseProxyObject:].
-		 *
-		 * I've seen one case where proxy.listObject referred to a zombie object. I can't reproduce. If that happens, we'll get a crash here in
-		 * debug mode only.  -evands 8/28/11
+		 * so never called [AIProxyListObject releaseProxyObject:]. -evands 8/28/11
 		 */
-		AILogWithSignature(@"%@ was leaked! Meh.", proxy.listObject);
-
-		proxy.listObject = inListObject;
-		proxy.containingObject = inContainingObject;
+		AILogWithSignature(@"%@ was leaked! Meh. We'll recreate the proxy for %@.", proxy.listObject, proxy.key);
+		[self releaseProxyObject:proxy];
+		proxy = nil;
 	}
 
 	if (!proxy) {
@@ -86,6 +82,13 @@
 	return proxy;
 }
 
+- (void)flushCache
+{
+	self.cachedDisplayName = nil;
+	self.cachedDisplayNameString = nil;
+	self.cachedLabelAttributes = nil;
+}
+
 /*!
  * @brief Called when an AIListObject is done with an AIProxyListObject to remove it from the global dictionary
  *
@@ -93,19 +96,12 @@
  */
 + (void)releaseProxyObject:(AIProxyListObject *)proxyObject
 {
-	AILogWithSignature(@"%@", proxyObject);
 	[[proxyObject retain] autorelease];
 	proxyObject.listObject = nil;
+	[proxyObject flushCache];
 	[proxyDict removeObjectForKey:proxyObject.key];
 }
 
-- (void)flushCache
-{
-	self.cachedDisplayName = nil;
-	self.cachedDisplayNameString = nil;
-	self.cachedLabelAttributes = nil;
-}
-
 - (void)dealloc
 {
 	AILogWithSignature(@"%@", self);




More information about the commits mailing list