Skip to content

Commit

Permalink
Merge pull request #6 from LordLobo/patch-1
Browse files Browse the repository at this point in the history
Make gradient collectable on line 57 prevents a leak
  • Loading branch information
domesticcatsoftware committed Dec 12, 2011
2 parents f0c34d8 + 883eb1d commit 70887c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions DCRoundSwitch/DCRoundSwitchKnobLayer.m
Expand Up @@ -56,6 +56,7 @@ CGGradientRef CreateGradientRefWithColors(CGColorSpaceRef colorSpace, CGColorRef
CGColorRef colors[] = {startColor, endColor};
CFArrayRef colorsArray = CFArrayCreate(NULL, (const void**)colors, sizeof(colors) / sizeof(CGColorRef), &kCFTypeArrayCallBacks);
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, colorsArray, colorStops);
[NSMakeCollectable(gradient) autorelease];
CFRelease(colorsArray);
return gradient;
}
Expand Down

0 comments on commit 70887c9

Please sign in to comment.