内存泄漏CoreImage

时间:2015-12-29 02:44:40

标签: ios memory-leaks core-image

仪器检测到此代码存在内存泄漏

- (UIImage *)blurryOriginalImageWithLevel:(CGFloat)blur
{
CIImage *inputImage = [CIImage imageWithCGImage:[UIImage imageNamed:@"ss"].CGImage];
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"
                              keysAndValues:kCIInputImageKey, inputImage,
                    @"inputRadius", @(blur),
                    nil];

CIImage *outputImage =inputImage;
if (filter) {
    outputImage=filter.outputImage;
}

CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef outImage = [context createCGImage:outputImage fromRect:[inputImage extent]];
UIImage *image = [UIImage imageWithCGImage:outImage];
CGImageRelease(outImage);
return image;
}

截图: enter image screenshots1

enter image screenshots2

但我在这段代码中找不到任何问题,我错了吗?

0 个答案:

没有答案