Skip to content

Dispose renderer when DrawingView is deinit.#763

Open
Moriquendi wants to merge 1 commit intoexyte:masterfrom
Moriquendi:leak-fix
Open

Dispose renderer when DrawingView is deinit.#763
Moriquendi wants to merge 1 commit intoexyte:masterfrom
Moriquendi:leak-fix

Conversation

@Moriquendi
Copy link

We saw that a lot of memory is leaked when creating SVGView this way:
SVGView(node: try! SVGParser.parse(text: path), frame: CGRect())

I did some debugging and I think I found the issue.
DrawingView is not disposing its renderer when it's deinit and so it's leaked. This PR fixes that.

Another way this leaks could be solved (and probably should be to avoid future leaks) is to make animationObservers on a Node a weak array so that it doesn't retain its observers.
It's a little bit of extra work but maybe someone will find some time to implement it.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant