Closed jnthn closed 2 years ago
Fixed in LibXML 0.7.8. This release also fixes several other memory leaks covered in #78.
All fixes were related to malloced strings not being freed by the Raku bindings.
Seems this improved the leaking in my use case (reports with Spreadsheet:XLSX
) quite a bit. Thanks for the fast reaction on Jonathan's report.
Doing
Str
on a node bottoms out, best I can tell, inanyNode
'sStr
function inLibXML::Raw
, which uses this native function:The called function allocates and returns a buffer, assuming the caller will free it. However, NativeCall assumes that the memory returned and converted to a
Str
should not be freed as part of the process. I've been able to work around this by using.Blob
instead (which it turns out is more efficient in my use case, since I was only encoding theStr
anyway). Probably the best bet is for.Str
to delegate to.Blob
and then.decode
the result.