Maybe this a newbie question, but according to my instruments there is a leak there, but im releasing the imageRef. i cant figure it out. its a category function.
-(UIImage *)imageAtRect:(CGRect)rect
{
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], rect);
UIImage* subImage = [UIImage imageWithCGImage: imageRef];
CGImageRelease(imageRef);
return subImage;
}
It turns out instruments flags the line where the leaked object is created. i am calling this function within another function that returns an UIImage (which is leaked, but doesn’t show on instruments) , i just set it to autorelease and it fixed the issue.