Can anyone tell me why this is method is giving me leaks? I've been looking at it for ages and can't figure out why its leaking. The leaked object is ContactOperations
. the EventType is Malloc and Release. I thought the init
might be wrong?
Contact Controller
ContactOperations *contactOps = [[ContactOperations alloc] initWithDatabase:database];
if ([contactOps applicationIsOwner])
[contactOps startOperations];
[contactOps release];
Instruments says the alloc is giving me the leak...
Contact Operations
ContactOperations
- (id)initWithDatabase:(Database*)aDatabase
{
if (self = [super init])
{
database = [aDatabase retain];
parameter = [[Parameter alloc] init];
parameter.database = aDatabase;
//addressBook = ABAddressBookCreate();
}
return(self);
}
-(void)dealloc
{
[database release];
[parameter release];
//CFRelease(addressBook);
}
contactOps
retained somewhere in-[ContactOperations startOperations]
? Other than that, there are no leaks in the code you posted. – CostiquecontactOps
tonil
after the release? If not, you technically have an overreleased instance still reachable from your code. – Monolo