我正在使用以下方法处理图像,第一行出现内存泄漏。该代码不是ARC,因此我必须手动释放内存。如何释放以下函数第一行中泄漏的内存?
-(UIImage*) manipulateImage :(UIImage *)image :(int)intType
{
CIImage* inputImage = [[[CIImage alloc] initWithImage:image] autorelease]; //leak is here.
CIFilter* filter = [CIFilter filterWithName:@"CIColorControls"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:@(intType) forKey:kCIInputSaturationKey];
CIImage* result = [filter valueForKey:kCIOutputImageKey];
CIImage* returnImage = [result imageByCroppingToRect:[result extent]];
return [[[UIImage alloc] initWithCGImage:returnImage.CGImage] autorelease];
}