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

set finalizer for XMLDocument by default #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robertfeldt
Copy link
Contributor

I propose most new users would rather prefer the finalizer is set by default. This does not solve the issue if people create their own XMLElement's but if they have a top-level XMLDocument the memory of it and all its sub-children will be gc'd once we no longer use the document.

@tkelman
Copy link
Contributor

tkelman commented Jan 28, 2015

Do we end up needing to keep a reference count for all the child elements? What happens if you have child elements still around but the top-level document goes out of scope?

@robertfeldt
Copy link
Contributor Author

Not sure, sorry. Sounds like it would wreak havoc... ;) Maybe keep it as a manual option then and people have to set the finalizer themselves.

@tonyhffong
Copy link

Should README.md be edited to say we don't need to free xdoc explicitly anymore? Are the examples in there canonical?

@tkelman
Copy link
Contributor

tkelman commented Feb 1, 2015

Unless there's a way to tell Julia's gc that child nodes are referring to the document and it should be kept alive until all of its children are also out of scope, I don't think setting a finalizer on xdoc is actually safe. Though we need to so some more experiments to be sure.

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.

3 participants