I don’t understand where is the leak here.
I am querying for a field in the database. After this, I am inserting in a NSMutableArray list.
@property (nonatomic, retain) NSMutableArray *bList;
@property (nonatomic, retain) NSString *icon;//Model
Model *newModel = [[Model alloc] init];
newModel.icon = [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 2)];
[self.bList addObject:newModel];
[newModel release];
And in the end:
- (void)dealloc {
[self.bList release];
[super dealloc];
}
Don’t do that; either use
self.bList = nil;or[bList release], bList = nil;There doesn’t appear to be a leak in that code, unless I’m missing something obvious.
Remember that
leaksidentifies where the leak was allocated, not where it was leaked. The leak is likely caused by an over-retain elsewhere.