From c69ac574cd8919f4fbac2d002c269076cdc77ba5 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Sat, 12 Jan 2019 22:19:59 +0200 Subject: [PATCH] [iOS] Fix glyph path and clip path release. --- ios/RNSVGNode.m | 3 +++ ios/Text/RNSVGTSpan.m | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ios/RNSVGNode.m b/ios/RNSVGNode.m index 685e181c..51c65506 100644 --- a/ios/RNSVGNode.m +++ b/ios/RNSVGNode.m @@ -283,6 +283,9 @@ CGFloat const RNSVG_DEFAULT_FONT_SIZE = 12; { if (self.clipPath) { _clipNode = (RNSVGClipPath*)[self.svgView getDefinedClipPath:self.clipPath]; + if (_cachedClipPath) { + CGPathRelease(_cachedClipPath); + } _cachedClipPath = CGPathRetain([_clipNode getPath:context]); if (_clipMask) { CGImageRelease(_clipMask); diff --git a/ios/Text/RNSVGTSpan.m b/ios/Text/RNSVGTSpan.m index 9a25fefc..c9171aae 100644 --- a/ios/Text/RNSVGTSpan.m +++ b/ios/Text/RNSVGTSpan.m @@ -752,8 +752,10 @@ static CGFloat RNSVGTSpan_radToDeg = 180 / (CGFloat)M_PI; // Glyphs whose midpoint-on-the-path are off the path are not rendered. if (midPoint > endOfRendering) { + CGPathRelease(glyphPath); continue; } else if (midPoint < startOfRendering) { + CGPathRelease(glyphPath); continue; }