#pragma mark -- Private Methods
-- (CGColorRef)HB_NSColorToCGColor:(NSColor *)color
+- (CGColorRef)copyNSColorToCGColor:(NSColor *)color
{
// CGColor property of NSColor has been added only in 10.8,
// we need to support 10.7 too.
CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius);
CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius);
CGContextClosePath(context);
- CGContextSetFillColorWithColor(context, [self HB_NSColorToCGColor:_badgeFillColor]);
+ CGColorRef fillColor = [self copyNSColorToCGColor:_badgeFillColor];
+ CGContextSetFillColorWithColor(context,fillColor);
+ CFRelease(fillColor);
CGContextDrawPath(context, kCGPathFill);
// Draw the text