Merge pull request #1217 from steadyapps/master

fix memory font memory leaks iOS
This commit is contained in:
Mikael Sand
2019-12-09 21:15:09 +02:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -263,7 +263,7 @@ import Svg, {
} from 'react-native-svg';
/* Use this if you are using Expo
import { Svg } from 'expo';
import * as Svg from 'react-native-svg';
const { Circle, Rect } = Svg;
*/
+4 -1
View File
@@ -191,7 +191,10 @@
CTFontDescriptorRef ctfd = (__bridge CTFontDescriptorRef)(uifd);
CTFontDescriptorRef newfd = CTFontDescriptorCreateCopyWithVariation(ctfd, wght_id, (CGFloat)weight);
CTFontRef newfont = CTFontCreateCopyWithAttributes(ref, size, nil, newfd);
return newfont;
CFRelease(newfd);
return (CTFontRef)CFAutorelease(newfont);
}
- (void)pushIndices
+3
View File
@@ -140,6 +140,9 @@ static CGFloat RNSVGTSpan_radToDeg = 180 / (CGFloat)M_PI;
TopAlignedLabel *label;
- (void)drawWrappedText:(CGContextRef)context gc:(RNSVGGlyphContext *)gc rect:(CGRect)rect {
[self pushGlyphContext];
if (fontRef != nil) {
CFRelease(fontRef);
}
fontRef = [self getFontFromContext];
RNSVGFontData* fontdata = [gc getFont];
CFStringRef string = (__bridge CFStringRef)self.content;