Fix memory leak in iOS RNSVGTSpan (#521)

This commit is contained in:
szakhlypa
2017-11-23 22:46:48 +01:00
committed by Dustin Savery
parent dcf0e5af2b
commit ffea98f863
+5
View File
@@ -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;
}