Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static analyzer warning #15

Open
cparnot opened this issue Jun 26, 2014 · 0 comments
Open

Static analyzer warning #15

cparnot opened this issue Jun 26, 2014 · 0 comments

Comments

@cparnot
Copy link

cparnot commented Jun 26, 2014

The line where the warning appears:

https://github.com/erndev/EDStarRating/blob/master/EDStarRating/EDStarRating.m#L186

The warning is: "Incorrect decrement of the reference count of an object that is not owned at this point by the caller"

The colorSpace object is created on line 182:

    CGColorSpaceRef colorSpace = [[color colorSpace] CGColorSpace];

The method should return an autoreleased CF object, afaict. It should not be released, or it would be overreleased and it could lead to a crash. It might still work ok if color spaces are singletons and never released, which I suspect is probably the case (I don't think a new color space obejct is created every time a color is created).

In any case, removing the release call would get rid of the static analyzer warning, and as far as I can tell, things work perfectly well without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant