|
CGPathRef CGPathFromSVGPathString(NSString *svgString) { |
|
CGPathRef const path = pathDefinitionParser(svgString).parse(); |
|
if(!path) { |
|
NSLog(@"*** Error: Invalid path attribute"); |
|
return NULL; |
|
} else |
|
return path; |
|
} |
Call to method pathDefinitionParser::parse returns a Core Foundation object of type CGMutablePathRef with a +1 retain count
Assuming path is non-null, object allocated and stored into path will be leaked.
CGPathFromSVGPathString does not contain Copy or Create. This violates the naming convention rules given in the Memory Management Guide for Core Foundation