You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
I'm seeing pointer being freed was not allocated sometimes when trying to set attribute. In particular when trying to set attribute that's been removed from document and added to fragment like this:
let xml = #"""
<item>
<item a="1"/>
</item>
"""#
let document = try XML.Document(string: xml)!
let three = document.search(xpath: "//*[@a=\"1\"]").first!
three.remove()
let fragment = DocumentFragment(children: { three })
three["a"] = "8"
I can avoid the crash if I create the document fragment like this instead:
let xmlDoc = document.rawValue.bindMemory(to: _xmlDoc.self, capacity: 1)
let fragment = DocumentFragment(rawValue: xmlNewDocFragment(xmlDoc))!
I guess it's bad to move and xml node belonging to a document to another node that doesn't belong to a document? Please let me know if you have a better idea of what's wrong and why the fix works.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm seeing
pointer being freed was not allocated
sometimes when trying to set attribute. In particular when trying to set attribute that's been removed from document and added to fragment like this:I can avoid the crash if I create the document fragment like this instead:
I guess it's bad to move and xml node belonging to a document to another node that doesn't belong to a document? Please let me know if you have a better idea of what's wrong and why the fix works.
The text was updated successfully, but these errors were encountered: