Correctly. Autorelease pools exist at Foundation level and above (AppKit / UIKit, etc.). They do not exist for CoreFoundation / CoreGraphics objects.
An easy way is to rename your function. If your function is currently called:
CGMutablePathRef myAwesomePath(params...);
Then you should rename it to:
CGMutablePathRef createMyAwesomePath(params...);
so that you can return the object with a saving of +1 by following the Create rule .
source
share