exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 554 forks source link

MacawView.doFindNode(location: CGPoint) causes a memory leak. #661

Closed kunwang closed 4 years ago

kunwang commented 4 years ago

Hi, I find a memory leak when MacawView.doFindNode is invoked. It should invoke MGraphicsEndImageContext() before return doFindNode.

private func doFindNode(location: CGPoint) -> NodePath? {
    MGraphicsBeginImageContextWithOptions(self.bounds.size, false, 1.0)
    if let ctx = MGraphicsGetCurrentContext() {
        return doFindNode(location: location, ctx: ctx) // here should invoke MGraphicsEndImageContext() before return doFindNode
    }
    MGraphicsEndImageContext()
    return .none
 }
amarunko commented 4 years ago

Hi, @kunwang, this issue already fixed in the master branch

kunwang commented 4 years ago

Hi, @kunwang, this issue already fixed in the master branch

Ok, thanks.