mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 08:45:00 +00:00
fix memory font memory leaks iOS
This commit is contained in:
@@ -191,7 +191,10 @@
|
|||||||
CTFontDescriptorRef ctfd = (__bridge CTFontDescriptorRef)(uifd);
|
CTFontDescriptorRef ctfd = (__bridge CTFontDescriptorRef)(uifd);
|
||||||
CTFontDescriptorRef newfd = CTFontDescriptorCreateCopyWithVariation(ctfd, wght_id, (CGFloat)weight);
|
CTFontDescriptorRef newfd = CTFontDescriptorCreateCopyWithVariation(ctfd, wght_id, (CGFloat)weight);
|
||||||
CTFontRef newfont = CTFontCreateCopyWithAttributes(ref, size, nil, newfd);
|
CTFontRef newfont = CTFontCreateCopyWithAttributes(ref, size, nil, newfd);
|
||||||
return newfont;
|
|
||||||
|
CFRelease(newfd);
|
||||||
|
|
||||||
|
return (CTFontRef)CFAutorelease(newfont);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)pushIndices
|
- (void)pushIndices
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ static CGFloat RNSVGTSpan_radToDeg = 180 / (CGFloat)M_PI;
|
|||||||
TopAlignedLabel *label;
|
TopAlignedLabel *label;
|
||||||
- (void)drawWrappedText:(CGContextRef)context gc:(RNSVGGlyphContext *)gc rect:(CGRect)rect {
|
- (void)drawWrappedText:(CGContextRef)context gc:(RNSVGGlyphContext *)gc rect:(CGRect)rect {
|
||||||
[self pushGlyphContext];
|
[self pushGlyphContext];
|
||||||
|
if (fontRef != nil) {
|
||||||
|
CFRelease(fontRef);
|
||||||
|
}
|
||||||
fontRef = [self getFontFromContext];
|
fontRef = [self getFontFromContext];
|
||||||
RNSVGFontData* fontdata = [gc getFont];
|
RNSVGFontData* fontdata = [gc getFont];
|
||||||
CFStringRef string = (__bridge CFStringRef)self.content;
|
CFStringRef string = (__bridge CFStringRef)self.content;
|
||||||
|
|||||||
Reference in New Issue
Block a user