Skip to content

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

@kunwang

Description

@kunwang

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
 }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions