honghaoz / Ji

Ji (戟) is an XML/HTML parser for Swift
MIT License
824 stars 64 forks source link

Fixed memory leaks #12

Closed ujell closed 8 years ago

ujell commented 8 years ago

There were small memory leaks that caused me some problems, so I fixed them. First one is retain cycle between Ji and JiNode classes. I fixed this with making document object unowned. Other one is a little bit trivial, while doing a xPath query if there's no nodes in xPathObject, it was returning an empty array without freeing xPathObject. This one is fixed by adding xmlXPathFreeObject before the return call.

honghaoz commented 8 years ago

@ujell Thanks! Everything looks good!