I have been tracking down memory leaks in my iOS app and I keep coming back to the following code using the leaks instrument:
NSMutableArray *resultSet = [[NSMutableArray alloc] initWithCapacity:3];
NSAutoreleasePool *innerPool = [[NSAutoreleasePool alloc] init];
FMResultSet *rs = [db executeQuery:query,equipmentID];
while ([rs next])
{
[resultSet addObject: [rs resultDict]];
}
[rs close];
[innerPool release];
return [resultSet autorelease];
Is this the correct (in terms of memory management) usage of FMDB? Here is a screenshot of the leaks instrument:
Detailed Screenshot of the leak: