CIImage memory leak

前端 未结 2 1977
暗喜
暗喜 2020-12-20 00:34

I\'m using the below method to blur some images. Using instruments the CIImage\'s are leaking. I tried wrapping them in an @autoreleasepool, but no luck. Any ideas?

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 00:41

    did you try to put CIImages to nil ?

    -(UIImage *)blurImage:(UIImage *)image withStrength:(float)strength
    {      
           //your code
           CGImageRelease(cgImage);
    
           cropped=nil;
           result = nil;
           inputImage = nil;
           context = nil;
    
           return returnImage;
         }
     }
    

提交回复
热议问题