title: Memory Leak iOS (UIImageView,UIImage,CGImage) not freed on ARC
body: <p>Im trying to implement a simple video stream but for some reason my memory won't get freed:</p>
  
  <pre><code>(void)updateImage:(UIImage *)image{
    self.indicator.hidden = TRUE;
    //CGImageRelease([self.imageView.image CGImage]);
    self.imageView.image = nil;
    self.imageView.image = image;
    [self.imageView setNeedsDisplay];
  }
  </code></pre>
  
  <p>If I use </p>
  
  <pre><code>CGImageRelease([self.imageView.image CGImage]);
  </code></pre>
  
  <p>memory will be freed. But when I return to a previous view controller the app will crash as it tries to free the allocated memory for that image, which I already freed. This method is called from a async task which creates an image using:</p>
  
  <pre><code>UIImage *image = [UIImage imageWithCGImage:cgImage];
  CGImageRelease(cgImage);
  CGDataProviderRelease(provider);
  CFRelease(data);
  </code></pre>
  
  <p>As I understood it the UIImage now owns the CGImage and I shouldn't have to release it.
  So is there anyway to ensure that the UIImage is freed when I updated the UIImageView with a new image?</p>