Skip to content

Commit

Permalink
XML deallloc after render-path is fullfilled
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed May 14, 2015
1 parent f9dd2ec commit 13898f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pxSVG/pxSVGRenderPath.m
Expand Up @@ -142,6 +142,7 @@ - (instancetype)initWithXML:(pxXMLNode *)xmlNode
} else {
self.bounds = self.root.bounds;
}
self.xml = nil;
return self;
}
- (pxSVGObject*)findDef:(NSString*)name inNode:(pxXMLNode*)xml
Expand All @@ -153,7 +154,10 @@ - (pxSVGObject*)findDef:(NSString*)name inNode:(pxXMLNode*)xml
if (def) return def;
}
def = [self findDef:name inNode:n];
if (def) return def;
if (def) {
[self.defCache setObject:def forKey:name];
return def;
}
}
return nil;
}
Expand Down Expand Up @@ -384,6 +388,7 @@ - (pxSVGObject*)parseObject:(pxXMLNode*)node inheritAttributes:(pxSVGObject*)inh
if (!obj.strokeColor)
obj.strokeColor = inherit?inherit.strokeColor:nil;
if (obj.id) [self.defCache setObject:obj forKey:obj.id];
if (obj.fillDef) [self findDef:obj.fillDef];
if (node.childNodes.count) {
NSMutableArray *subnodes = [NSMutableArray new];
for (pxXMLNode *n in node.childNodes) {
Expand Down

0 comments on commit 13898f1

Please sign in to comment.