I have a method that returns a CGMutablePathRef, something like this:
- (CGMutablePathRef)somePath;
{
CGMutablePathRef theLine = CGPathCreateMutable();
CGPathMoveToPoint(theLine, NULL, 50, 50);
CGPathAddLineToPoint(theLine, NULL, 160, 480);
CGPathAddLineToPoint(theLine, NULL, 270, 50);
return theLine;
}
The Xcode/Clang static analyzer warns that there's a potential leak. The docs say to call CGPathRelease() but where would I put that?
If I put that before the method returns won't that cause theLine to disappear before it's returned to it's caller?