我一直在跟踪我的 iOS 应用程序中的内存泄漏,并且我一直使用泄漏工具返回以下代码:
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];
这是 FMDB 的正确使用(就内存管理而言)吗?这是泄漏仪器的屏幕截图:
泄漏的详细截图: