When I analyze my iPhone app I have a blue arrow warning which says:
potential leak of an object stored into pauseImgBg
I simply crop a partial image from an atlas and put it into the pauseMenuIV imageView.
CGImageRef pauseImgBg = CGImageCreateWithImageInRect([UIImage imageNamed:@"atlas.png"].CGImage, CGRectMake(1, 1, 640.0f, 960.0f));
pauseMenu = [UIImage imageWithData:UIImagePNGRepresentation([UIImage imageWithCGImage:pauseImgBg])];// I have the blue arrow in this line
[pauseMenuIV setImage:pauseMenu];
What could be the problem ?
Thanks.
CGImageCreateWithImageInRectreturns a CGImageRef with a retain count of +1. So you must release the recevied CGImageRef.in the end. Try and read the documentation when you have the time. It will help you to isolate these kinds of cases. From documentation
And from the documentation of CGImageCreateWithImageInRect itself