I have finally managed to fix all of the leaks in XML::Bare. I will release the new version this upcoming weekend. I would release it now, but I would like to fix the licensing issues with the test xml files in the distribution before I release.
Note to anyone trying to patch memory leaks in XS code: check out
the following modules:
1. Devel::LeakTrace::Fast ( for finding the general location of leaks )
2. Devel::Peek ( for dumping the full structure of variables and finding reference counting problems )
3. Data::Dumper ( no reference count info, but is capable of easily showing circular references and weird reference problems )
4. Devel::Monitor ( to get a basic idea of when variables are freed if at all )
5. Devel::Leak ( see 1; this one is not very useful compared to Devel::LeakTrace )
Also, valgrind deserves mention as the only truly complete way to check for memory leaks across any type of code.