adium 2317:8cbd61f26a47: Add a bit of debug logging for crashes ...

commits at adium.im commits at adium.im
Mon May 25 08:11:15 UTC 2009


details:	http://hg.adium.im/adium/rev/8cbd61f26a47
revision:	2317:8cbd61f26a47
author:		David Smith <catfish.man at gmail.com>
date:		Mon May 25 01:10:51 2009 -0700

Add a bit of debug logging for crashes like http://pastebin.com/m3f991514. Pretty sure this is due to proxy memory management issues

diffstat:

 Frameworks/Adium Framework/Source/AIAbstractListController.m |  9 +++++++++
 Frameworks/Adium Framework/Source/AIProxyListObject.m        |  3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diffs (39 lines):

diff -r 4411618e73f7 -r 8cbd61f26a47 Frameworks/Adium Framework/Source/AIAbstractListController.m
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m	Sun May 24 23:42:23 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m	Mon May 25 01:10:51 2009 -0700
@@ -50,6 +50,10 @@
 
 #import "AIProxyListObject.h"
 
+#ifdef DEBUG_BUILD
+#import <Foundation/NSDebug.h>
+#endif
+
 #define CONTENT_FONT_IF_FONT_NOT_FOUND	[NSFont systemFontOfSize:10]
 #define STATUS_FONT_IF_FONT_NOT_FOUND	[NSFont systemFontOfSize:10]
 #define GROUP_FONT_IF_FONT_NOT_FOUND	[NSFont systemFontOfSize:10]
@@ -658,6 +662,11 @@
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(AIProxyListObject *)item
 {
+#ifdef DEBUG_BUILD
+	if (NSIsFreedObject(item)) {
+		NSLog(@"Attempting to use a freed listobject proxy in %@", NSStringFromSelector(_cmd));
+	}
+#endif
 	return (!item || ([item.listObject conformsToProtocol:@protocol(AIContainingObject)] && 
 					  ((id<AIContainingObject>)(item.listObject)).isExpandable));
 }
diff -r 4411618e73f7 -r 8cbd61f26a47 Frameworks/Adium Framework/Source/AIProxyListObject.m
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.m	Sun May 24 23:42:23 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.m	Mon May 25 01:10:51 2009 -0700
@@ -39,6 +39,9 @@
 	if (proxy && proxy.listObject != inListObject) {
 		// If the old list object is for some reason invalid (released in contact controller, but not fully released)
 		// we end up with an old list object as our proxied object. Correct this by getting rid of the old one.
+#ifdef DEBUG_BUILD
+		NSLog(@"Attempting to correct for old proxy listobject");
+#endif
 		[proxy.listObject removeProxyObject:proxy];
 		[self releaseProxyObject:proxy];
 		proxy = nil;




More information about the commits mailing list