Dennis Pashkov
Dennis Pashkov

Reputation: 944

CTFontCopyFamilyName() causes leak

I am developing a program, that uses Core Text... And I have a leak in the following line of code:

NSString *familyName = (NSString*)CTFontCopyFamilyName(font);

When I write CFRelease((CFStringRef)familyName); I get bad access exception. When I write [familyName release]; I have the same issue. Can anyone help me please?

Upvotes: 0

Views: 149

Answers (1)

rishi
rishi

Reputation: 11839

Use -

NSString *familyName = [(NSString*)CTFontCopyFamilyName(font) autorelease];

Upvotes: 2

Related Questions