I've just started with releasing in core graphics, so I might need a little help.
I have code which looks like this:
UIImage *buttonImage() {
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB();
CGMutablePathRef outerPath;
CGMutablePathRef midPath;
CGMutablePathRef innerPath;
CGMutablePathRef highlightPath;
//Some button stuff
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGContextRelease(context);
return image;
}
That release line, I've put in. I'm getting an error with it though:
context_reclaim: invalid context
context_finalize: invalid context
Any thoughts as to where i should put the release in this instance?