PDA

View Full Version : Memory Leak




asheshsj
Jan 22, 2009, 12:30 PM
My code below is causing memory leak. Can someone please have a look at it and give me a solution

NSData *data = [[NSData alloc] initWithContentsOfURL:imgurl];
[fileManager createDirectoryAtPath:imagePath attributes:nil];
[data writeToFile:imageFilePath atomically:NO];
[getProfile setObject:imageFilePath forKey:@"img"];
[testArray1 addObject:getProfile];
[data release];
[getProfile release];
}

Thanks,
A



macfanboy
Jan 22, 2009, 04:20 PM
just fyi for next time, use the code format in the text options next time you want to paste code. it's much easier to read that way.