From 5d81bf1608fa9eac0dd1647b8150b314f0cd6d5a Mon Sep 17 00:00:00 2001 From: Stephane Moore Date: Wed, 21 Aug 2013 17:40:23 -0700 Subject: [PATCH] [NIAttributedLabel] Fix a new NIAttributedLabel analyzer warning in Xcode 4.6.3. --- src/attributedlabel/src/NIAttributedLabel.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/attributedlabel/src/NIAttributedLabel.m b/src/attributedlabel/src/NIAttributedLabel.m index 62e5f5bb8..a1694bb93 100644 --- a/src/attributedlabel/src/NIAttributedLabel.m +++ b/src/attributedlabel/src/NIAttributedLabel.m @@ -1492,7 +1492,9 @@ - (void)drawTextInRect:(CGRect)rect { CGPathAddRect(path, NULL, rect); CTFrameRef textFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL); self.textFrame = textFrame; - CFRelease(textFrame); + if (textFrame) { + CFRelease(textFrame); + } CGPathRelease(path); CFRelease(framesetter); }