adium-1.4 3632:1a4f7278fd3c: Don't attempt to reuse the AIProxyL...
commits at adium.im
commits at adium.im
Tue Aug 30 00:43:22 UTC 2011
details: http://hg.adium.im/adium-1.4/rev/1a4f7278fd3c
revision: 3632:1a4f7278fd3c
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.
(transplanted from 7c3822c44c0f57c761f1e322c3641596d17a69d4)
diffs (58 lines):
diff -r 6faa02098034 -r 1a4f7278fd3c 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
@@ -49,15 +49,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) {
@@ -74,6 +70,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
*
@@ -81,19 +84,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