Hello there, I have a problem I just can't seem to figure out in my code. When I run my app using Instruments, I keep showing a memory leak. I didn't think that UIImages could leak, but that is what it is showing. I am really hoping that someone will be able to help me understand this and also give me an idea of how to fix it. Thanks in advance!
Code:
UIGraphicsBeginImageContext(test.size);
[image1 drawInRect:CGRectMake(0,0, test.size.width, test.size.height)];
[image2 drawInRect:CGRectMake(0,0, test.size.width, test.size.height)];
//the next line is the leak
UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultingImage;