Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeContainerFormat transform methods dispose all the children #126

Open
Kaplas80 opened this issue Nov 20, 2019 · 1 comment
Open

NodeContainerFormat transform methods dispose all the children #126

Kaplas80 opened this issue Nov 20, 2019 · 1 comment

Comments

@Kaplas80
Copy link
Contributor

Describe the bug
All the children are disposed after calling any Node transform method on a NodeContainerFormat.

To Reproduce
Steps to reproduce the behavior:
TransformNodeContainerProblem.zip
I've attached a demo to see the issue. After the TransformWith call, all the children are disposed.

Expected behavior
As the children have a new root node, they should remain undisposed.

@pleonex
Copy link
Member

pleonex commented Nov 21, 2019

It's a difficult case because the lifecycle (dispose) ownership of the children nodes is shared in three different objects: the parent Node, the source NodeContainerFormat and the new NodeContainerFormat.

As discussed internally, we have found a specific workaround / new strategy for your use-case: use the Tags property of the Nodes and remove the intermediate converter.

But we need to think about this mess of shared lifecycle with the children nodes because this use case of converter NodeContainerFormat -> NodeContainerFormat copying some of the original Nodes is broken and we may find more issues in the future.

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

No branches or pull requests

2 participants