I have a class that is a subclass of NSOperation (actually a subclass of ASIHTTPRequest, which is a subclass of NSOperation).
Tools report a memory leak in __NSOperationInternal, with this call stack:
0 libSystem.B.dylib calloc
1 libobjc.A.dylib _internal_class_createInstanceFromZone
2 libobjc.A.dylib class_createInstance
3 CoreFoundation +[NSObject(NSObject) allocWithZone:]
4 CoreFoundation +[NSObject(NSObject) alloc]
5 CoreFoundation +[NSObject(NSObject) new]
6 Foundation -[NSOperation init]
7 MyApp -[JSONRequest init] JSONRequest.m:26
JSONRequest init and dealloc look like this:
- (id)init
{
if ((self = [super init]))
{
[self setDidFinishSelector:@selector(JSONFinished:)];
[self setDidFailSelector:@selector(JSONLoadFailed:)];
}
return self;
}
- (void)dealloc {
[super setDelegate:nil];
[super dealloc];
}
I see no error in my code, wherever it is. Perhaps this is a false leak, or can someone figure out what might be wrong with the code? (Are there any recommendations to indicate if the leak reported by the tools is false or not?)
This is the only information about the leak (i.e., none of the properties of the objects leak), but this leak is reported several times during the launch of my application.