title: UIGraphicsGetImageFromCurrentImageContext leaking
body: <p>I have a leak and I can't see where.</p>
  
  <p>This is part of my code:</p>
  
  <pre><code>+ (UIImage *) imageWithColor:(UIColor *) color andSize:(CGSize) size {
  
      UIGraphicsBeginImageContext(size);
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGContextSetFillColorWithColor(context, color.CGColor);
      CGContextFillRect(context, CGRectMake(0, 0, size.width, size.height));
  
      UIImage *colorImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();    
  
      return colorImage;
  }
  </code></pre>
  
  <p>and then I use the returned UIImage as the track and progress images of a UIProgressView</p>
  
  <pre><code>UIImage* trackImage = [ImageUtils imageWithColor:[UIColor blackColor] andSize:CGSizeMake(self.myProgressView.frame.size.width, 3)];
  UIImage* progressImage = [ImageUtils imageWithColor:[UIColor whiteColor] andSize:CGSizeMake(self.myProgressView.frame.size.width, 3)];
  
  [self.myProgressView setTrackImage:trackImage];
  [self.myProgressView setProgressImage:progressImage];
  </code></pre>
  
  <p>But, somehow, after I released the object containing the Progress View, this causes a leak pointing to UIGraphicsGetImageFromCurrentImageContext. How can I fix it?</p>