mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 07:25:53 +00:00
Fix memory leak in iOS RNSVGTSpan (#521)
This commit is contained in:
@@ -858,6 +858,8 @@ bool hasGlyph(CTFontRef fontRef, NSString * str, CGGlyph* glyph, CFDictionaryRef
|
||||
|
||||
CFIndex runEnd = CFArrayGetCount(runs);
|
||||
if (runEnd > 1) {
|
||||
CFRelease(attrString);
|
||||
CFRelease(line);
|
||||
return false;
|
||||
}
|
||||
CTRunRef run = CFArrayGetValueAtIndex(runs, 0);
|
||||
@@ -868,6 +870,9 @@ bool hasGlyph(CTFontRef fontRef, NSString * str, CGGlyph* glyph, CFDictionaryRef
|
||||
CTRunGetGlyphs(run, CFRangeMake(0, 1), glyph);
|
||||
}
|
||||
|
||||
CFRelease(attrString);
|
||||
CFRelease(line);
|
||||
|
||||
return hasGlyph;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user