コア グラフィックスのリリースを始めたばかりなので、少し助けが必要かもしれません。
次のようなコードがあります。
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;
}
そのリリースラインを入れました。ただし、エラーが発生します:
context_reclaim: invalid context
context_finalize: invalid context
この場合、リリースをどこに置くべきかについて何か考えはありますか?