Permalink
Browse files

Merge pull request #6 from LordLobo/patch-1

Make gradient collectable on line 57 prevents a leak
  • Loading branch information...
2 parents f0c34d8 + 883eb1d commit 70887c99dca9ccccf056f2f966057a2de68c1af7 @domesticcatsoftware committed Dec 12, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 DCRoundSwitch/DCRoundSwitchKnobLayer.m
@@ -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;
}

0 comments on commit 70887c9

Please sign in to comment.