You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice catch. But we can't simply CFRelease(currentFont) as it would crash in the case the previous line did return a non-nil CFFont (if we don't enter the if)…
To avoid a crash here if we add a CFRelease later, we need to CFRetain it when it's non-nil (in an else condition corresponding to this if statement), so that the CFRelease will balance the retain count in both situations (either when we get it from the attribute then retain it, or if we CTFontCreate it directly)
Xcode 5 analyzer warns about a potential leak of
currentFont
inNSAttributedString+Attributes.m
here.It seems that a simple
CFRelease(currentFont)
would fix it.The text was updated successfully, but these errors were encountered: