rvosa / bio-phylo

Bio::Phylo - Phyloinformatic analysis using Perl
http://search.cpan.org/dist/Bio-Phylo
GNU General Public License v3.0
16 stars 6 forks source link

Fix memory leak #16

Closed rvosa closed 9 years ago

rvosa commented 10 years ago

Objects that are inserted in Bio::Phylo::Listable containers appear to stay alive even beyond the point when the container goes out of scope and is cleaned up. This causes a memory leak that should be fixed. The behaviour is demonstrated in t/37-memory.t, which skips the problematic tests as of commit 340f24be5404bd9ce3d2a56cc406243fdc0d3d39

rvosa commented 10 years ago

More progress: the MOP class is not actually fetching all methods with the attribute 'Destructor', so they weren't triggered by DESTROY. Since all these methods are in fact called _cleanup(), a workaround is to just call _cleanup on all the packages in @ISA that have it. These addresses most of the failing tests in 37-memory.t, except the ones that concern taxa inside project objects, for some reason.

moritz commented 9 years ago

FWIW all tests pass for me, even when I remove the last remaining skip in t/37-memory. Can this issue be closed?