Skip to content
Snippets Groups Projects
Commit cb515913 authored by Graham McVicker's avatar Graham McVicker
Browse files

warn if there is a potential memory leak

parent c24cee23
No related branches found
No related tags found
No related merge requests found
......@@ -170,8 +170,13 @@ sub DESTROY {
#print STDERR "Container::DESTROY : Breaking circular references:\n";
if($self->_obj->can('deleteObj')) {
$self->_obj->deleteObj();
my $obj = $self->_obj;
if(!$obj) {
$self->warn("Bio::EnsEMBL::Container: potential memory leak, contained\n"
. "object is not defined during garbage collection.");
} elsif($obj->can('deleteObj')) {
$obj->deleteObj();
}
$self->{_obj} = undef;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment