sparklemotion / nokogiri

Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
https://nokogiri.org/
MIT License
6.14k stars 899 forks source link

use `xmlFreeNode` in xml_document.c to deallocate unparented nodes of all types #1826

Open flavorjones opened 5 years ago

flavorjones commented 5 years ago

As @stevecheckoway pointed out in https://github.com/sparklemotion/nokogiri/issues/1784 we might be able to avoid the case statement in dealloc_node_i and let xmlFreeNode take care of it for us.

This change would be a simplification, but I need to spend some time digging into:

Both of these features have been around since 2009 (1aa012a7) and I couldn't quickly find a clear reason why. Let's be careful here not to introduce an inadvertent memory leak.

flavorjones commented 5 years ago

@rubarb666 can you explain a bit more about your comment?

flavorjones commented 5 years ago

I'd like to block this on #1603 which will add the memory leak test suite to CI

flavorjones commented 3 months ago

Hey! The memory leak suite has been back in effect since 6326caa3 (2023-12-10) so let's do this.