fix mem-leak analyzer warning

Although the analyzer is wrong here (highlighFramesetter property is synthesized), it doesn't hurt
to use the instance variables.
This commit is contained in:
Stephan Diederich 2013-06-20 14:22:48 +02:00
parent 3c25f25945
commit 070844e234

View File

@ -826,8 +826,8 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N
NSMutableAttributedString *highlightAttributedString = [self.renderedAttributedText mutableCopy];
[highlightAttributedString addAttribute:(NSString *)kCTForegroundColorAttributeName value:(id)[self.highlightedTextColor CGColor] range:NSMakeRange(0, highlightAttributedString.length)];
if (!self.highlightFramesetter) {
self.highlightFramesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)highlightAttributedString);
if (!_highlightFramesetter) {
_highlightFramesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)highlightAttributedString);
}
[self drawFramesetter:self.highlightFramesetter attributedString:highlightAttributedString textRange:textRange inRect:textRect context:c];