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
After using addNextSibling method. Application crashes during XMLDocument.deinit
deinit {
xmlFreeDoc(self.docPtr)
}
with malloc: *** error for object 0x7fee7f04465b: pointer being freed was not allocated
What I want to do?
I want to replace few nodes with new ones in xml.
How I am doing it?
if let doc = try? HTML(html: content, encoding: .utf8) {
for media in doc.xpath("//replace-tag") {
let img = "<img />"
if let imgTag = try? XML(xml: img, encoding: .utf8) {
media.addNextSibling(imgTag.xpath("//img")[0])
}
}
If I remove the addNextSibling method call, all works.
Before deallocating XMLDocument I can see that doc has properly attached img tags as in code.
Installation method:
Carthage
CocoaPods
Swift Package Manager
Manually
other: ()
Kanna version (or commit hash):
4.0.0
swift --version
4.2
Xcode version (optional):
10.1
The text was updated successfully, but these errors were encountered:
Description:
After using
addNextSibling
method. Application crashes duringXMLDocument.deinit
with
malloc: *** error for object 0x7fee7f04465b: pointer being freed was not allocated
What I want to do?
I want to replace few nodes with new ones in xml.
How I am doing it?
If I remove the
addNextSibling
method call, all works.Before deallocating
XMLDocument
I can see thatdoc
has properly attachedimg
tags as in code.Installation method:
Kanna version (or commit hash):
4.0.0
swift --version
4.2
Xcode version (optional):
10.1
The text was updated successfully, but these errors were encountered: