Skip to content

Fixes #2 by ensuring that Xml2Doc is last to die.#8

Merged
redvers merged 1 commit into
mainfrom
thread_xml2doc_for_finalizer
Jan 11, 2026
Merged

Fixes #2 by ensuring that Xml2Doc is last to die.#8
redvers merged 1 commit into
mainfrom
thread_xml2doc_for_finalizer

Conversation

@redvers
Copy link
Copy Markdown
Collaborator

@redvers redvers commented Jan 11, 2026

In our previous iteration of this API we had Pony Class instances freeing C structs which were still referenced by Xml2Doc.

The documentation states that for our current parsing use-cases it is unsafe to automatically _final() free any of the XmlNodes as they're a part of our XmlDoc tree.

As such, we have threaded a tag reference through every dependent Pony instance so that it will be "impossible"™ for Xml2Doc._final() to execute the frees until all other dependent references are no longer reachable.

@redvers
Copy link
Copy Markdown
Collaborator Author

redvers commented Jan 11, 2026

Hi @redvers,

The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 8.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

In our previous iteration of this API we had Pony Class instances
freeing C structs which were still referenced by Xml2Doc.

The documentation states that for our current parsing use-cases it
is unsafe to automatically _final() free any of the XmlNodes as they're
a part of our XmlDoc tree.

As such, we have threaded a tag reference through every dependent Pony
instance so that it will be "impossible"™ for Xml2Doc._final() to
execute the frees until all other dependent references are no longer
reachable.
@redvers redvers force-pushed the thread_xml2doc_for_finalizer branch from c93872d to 56525e2 Compare January 11, 2026 06:24
@redvers redvers changed the title Fixes #1 by ensuring that Xml2Doc is last to die. Fixes #2 by ensuring that Xml2Doc is last to die. Jan 11, 2026
@redvers redvers merged commit 910e2ef into main Jan 11, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Jan 11, 2026
github-actions Bot pushed a commit that referenced this pull request Jan 11, 2026
@redvers redvers deleted the thread_xml2doc_for_finalizer branch January 11, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant