I got the following line of code:
mainLayer.shadowColor = CGColorCreate( CGColorSpaceCreateDeviceRGB(), components );
When I run Product-> Analyze in xcode, it gives me a warning:
Potential leak of an object allocated on line 176
So this means that I am not releasing my CGColor. So I thought the following would be a good solution:
CGColorRef shadowColor = CGColorCreate( CGColorSpaceCreateDeviceRGB(), components );
mainLayer.shadowColor = shadowColor;
CGColorRelease( shadowColor );
But I still get the same leak warning. How to fix the problem?
source
share