Skip to content

Add DESTROY methods for guaranteed resources dealloction

Marek Szuba requested to merge github/fork/Zhicheng-Liu/bugfix/leak into master

Created by: Zhicheng-Liu

These methods will be called when their corresponding objects are garbage collected. Adding these where needed to deallocate underlying C objects and/or release resources.

Also remove "close" methods where possible to avoid these being called where the objects may be referenced by multiple references and the references may become dangling.

Also add Bio::DB::HTS::VCF::HeaderPtr and Bio::DB::HTS::VCF::RowPtr packages to refer to a pointer object returned from C where it is just a pointer to the underlying C object but does not own it (like in vcf_sweep). Use the already existed Bio::DB::HTS::VCF::Header and Bio::DB::HTS::VCF::Row for the objects that the pointers actually own and are responsible for deallocation if needed.

Minor changes to test cases to accommodate the above changes.

Merge request reports