title: Memory leak for CoreImage
body: <p>I have created blur image as below:</p>
  
  <pre><code>//Blur the UIImage
  CIImage *imageToBlur = [CIImage imageWithCGImage:viewImage.CGImage];
  CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"];
  [gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"];
  [gaussianBlurFilter setValue:[NSNumber numberWithFloat: 2] forKey: @"inputRadius"];
  CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"];
  CIImage *finalImage = [resultImage imageByCroppingToRect:CGRectMake(0, 10, self.view.bounds.size.width, self.view.bounds.size.height)];
  
  //create UIImage from filtered image
  UIImage *blurrredImage = [[UIImage alloc] initWithCIImage:finalImage];
  
  CIFilter *colorMatrixFilter = [CIFilter filterWithName:@"CIColorMatrix"];
  [colorMatrixFilter setDefaults];
  [colorMatrixFilter setValue:finalImage forKey:kCIInputImageKey];
  [colorMatrixFilter setValue:[CIVector vectorWithX:0.25 Y:0 Z:0 W:0] forKey:@"inputRVector"];
  [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0.35 Z:0 W:0] forKey:@"inputGVector"];
  [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0 Z:0.4 W:0] forKey:@"inputBVector"];
  [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:1] forKey:@"inputAVector"];
  
  // Get the output image recipe
  CIImage *outputImage = [colorMatrixFilter outputImage];
  
  // Create the context and instruct CoreImage to draw the output image recipe into a CGImage
  CIContext *context = [CIContext contextWithOptions:nil];
  CGImageRef cgimg = [context createCGImage:outputImage fromRect:[outputImage extent]];
  blurrredImage = [UIImage imageWithCGImage:cgimg];
  
  
  CGImageRelease(cgimg);
  
  //Place the UIImage in a UIImageView
  UIImageView *newView = [[UIImageView alloc] initWithFrame:self.view.bounds];
  newView.image = blurrredImage;
  
  //insert blur UIImageView below transparent view inside the blur image container
  [blurContainerView insertSubview:newView belowSubview:transparentView];
  </code></pre>
  
  <p>I have released the CGImageRef, but still getting the memory leak at </p>
  
  <pre><code>CGImageRef cgimg = [context createCGImage:outputImage fromRect:[outputImage extent]];
  </code></pre>
  
  <p>I am also referred all other related questions and and implement the provided answers still getting memory leak</p>
  
  <p>Used @autoreleasepool { } and try to set object to nil</p>
  
  <pre><code>context = nil;
  outputImage = nil;
  gaussianBlurFilter = nil;
  viewImage = nil;
  </code></pre>
  
  <p>before </p>
  
  <pre><code>CGImageRelease(cgimg);
  </code></pre>
  
  <p>Still it shows the memory leak and description is as below. ARC is on and ios version is 6.1 and 7</p>
  
  <p>Responsible Library is : CoreImage
  Responsible Caller is : CI::GLESContext::program_for_name(__CFString const*)</p>
  
  <p>Can anybody please suggest me how can i resolved this memory leak?</p>
  
  <p>Thanks for the help in advance.</p>