NSMutableDictionary Leak
NSMutableDictionary Leak
- Subject: NSMutableDictionary Leak
- From: dct <email@hidden>
- Date: Fri, 28 Nov 2008 16:04:17 -0800
I've started using Instruments/Leaks on a project that has been
building and running as expected. It has identified a goodly number of
CFDictionary leaks (a Malloc leak followed by an Autorelease leak)
associated with lines that, in one typical case, reads:
[tmp setObject:[NSDictionary dictionaryWithDictionary:tmp2]
forKey:@"Data"];
The MutableDictionary object "tmp" is instantiated at the beginning of
this particular method by:
NSMutableDictionary *tmp = [[NSMutableDictionary
dictionaryWithCapacity:4] autorelease];
Do I need to autorelease a la:
[tmp setObject:[[NSDictionary dictionaryWithDictionary:tmp2]
autorelease] forKey:@"Data"];
or is this a non-problem given that the reported Malloc leak is
followed by an Autorelease leak?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden