Problem: It may have CGMutablePathRefbeen created and installed, but it may not.
CGMutablePathRef
What I'm doing right now in -dealloc:
-dealloc
if (path != NULL) { CGPathRelease(path); path = NULL; }
Is it correct?
From the manual,
void CGPathRelease (Path CGPathRef);This function is equivalent to CFRelease, except that it does not throw an error if the path parameter is NULL.
void CGPathRelease (Path CGPathRef);
This function is equivalent to CFRelease, except that it does not throw an error if the path parameter is NULL.
Thus, there is no need to check for NULL.