Skip to content

Commit 16db9a8

Browse files
committed
Merge pull request #24 from pronebird/patch-2
Use CF convention for methods returning retained unmanaged objects
2 parents b9cbde6 + 732dfbc commit 16db9a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

THLabel/THLabel.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ - (void)drawRect:(CGRect)rect {
424424
CFRelease(frameRef);
425425
}
426426

427-
- (CTFrameRef)frameRefFromSize:(CGSize)size textRectOutput:(CGRect *)textRectOutput {
427+
- (CTFrameRef)frameRefFromSize:(CGSize)size textRectOutput:(CGRect *)textRectOutput CF_RETURNS_RETAINED {
428428
// Set up font.
429429
CTFontRef fontRef = CTFontCreateWithName((__bridge CFStringRef)self.font.fontName, self.font.pointSize, NULL);
430430
CTTextAlignment alignment = NSTextAlignmentToCTTextAlignment ? NSTextAlignmentToCTTextAlignment(self.textAlignment) : [self CTTextAlignmentFromNSTextAlignment:self.textAlignment];
@@ -575,7 +575,7 @@ - (UIEdgeInsets)fittingTextInsets {
575575

576576
#pragma mark - Image Functions
577577

578-
- (CGImageRef)inverseMaskFromAlphaMask:(CGImageRef)alphaMask withRect:(CGRect)rect {
578+
- (CGImageRef)inverseMaskFromAlphaMask:(CGImageRef)alphaMask withRect:(CGRect)rect CF_RETURNS_RETAINED {
579579
// Create context.
580580
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0);
581581
CGContextRef context = UIGraphicsGetCurrentContext();
@@ -592,7 +592,7 @@ - (CGImageRef)inverseMaskFromAlphaMask:(CGImageRef)alphaMask withRect:(CGRect)re
592592
return image;
593593
}
594594

595-
- (CGImageRef)strokeImageWithRect:(CGRect)rect frameRef:(CTFrameRef)frameRef strokeSize:(CGFloat)strokeSize strokeColor:(UIColor *)strokeColor {
595+
- (CGImageRef)strokeImageWithRect:(CGRect)rect frameRef:(CTFrameRef)frameRef strokeSize:(CGFloat)strokeSize strokeColor:(UIColor *)strokeColor CF_RETURNS_RETAINED {
596596
// Create context.
597597
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0);
598598
CGContextRef context = UIGraphicsGetCurrentContext();
@@ -625,7 +625,7 @@ - (CGImageRef)strokeImageWithRect:(CGRect)rect frameRef:(CTFrameRef)frameRef str
625625
return image;
626626
}
627627

628-
- (CGImageRef)linearGradientImageWithRect:(CGRect)rect fadeHead:(BOOL)fadeHead fadeTail:(BOOL)fadeTail {
628+
- (CGImageRef)linearGradientImageWithRect:(CGRect)rect fadeHead:(BOOL)fadeHead fadeTail:(BOOL)fadeTail CF_RETURNS_RETAINED {
629629
// Create an opaque context.
630630
UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0.0);
631631
CGContextRef context = UIGraphicsGetCurrentContext();

0 commit comments

Comments
 (0)