remove defined ClipPath after <ClipPath /> is unmounted

This commit is contained in:
Horcrux
2016-04-27 23:31:33 +08:00
parent 90887a29ee
commit 6da1b5887f
+7 -1
View File
@@ -13,6 +13,9 @@
static NSMutableDictionary *ClipPaths;
@implementation RNSVGNode
{
NSString *definedClipPathId;
}
- (void)insertSubview:(UIView *)subview atIndex:(NSInteger)index
{
@@ -94,13 +97,16 @@ static NSMutableDictionary *ClipPaths;
if (ClipPaths == NULL) {
ClipPaths = [[NSMutableDictionary alloc] init];
}
definedClipPathId = clipPathId;
[ClipPaths setValue:[NSValue valueWithPointer:_clipPath] forKey:clipPathId];
}
- (void)dealloc
{
CGPathRelease(_clipPath);
if (definedClipPathId) {
[ClipPaths removeObjectForKey:definedClipPathId];
}
}