I have enabled the static analyzer, but it is telling me that at the end of that execution path that object didn't get released, hence possibly causing a memory leak. I am however passing that reference to the created object to another class which will release it. I was wondering if there is a method or keyword to tell the compiled that I will release this object later.
I am looking for something like the auto-release.
By the way, I am using ARC.
I create the object like this:
CGMutablePathRef pathRef = CGPathCreateMutable();
And pass it like this:
self.flowView.pathToDraw = pathRef;
In my flowView class I have this method that will release it.
-(void) setPathToDraw:(CGMutablePathRef) newPath {
if(pathToDraw!=NULL) CGPathRelease(pathToDraw);
pathToDraw=newPath;
[self setNeedsDisplay];
}
I already tried looking at the GCPath documentation but I had no luck.
Thanks