Skip to content
Snippets Groups Projects
Commit 5afcc259 authored by Kieron Taylor's avatar Kieron Taylor :angry:
Browse files

[ENSCORESW-1664] Close up leaked internal cache in Gene object

parent 2e11580f
No related branches found
No related tags found
No related merge requests found
......@@ -1013,7 +1013,8 @@ sub get_all_Transcripts {
$self->{'_transcript_array'} = $transcripts;
}
}
return $self->{'_transcript_array'};
my @array_copy = @{ $self->{'_transcript_array'} };
return \@array_copy;
}
......
......@@ -284,6 +284,13 @@ foreach my $tr (@{$gene->get_all_Transcripts()}) {
ok($count == 5);
ok($translates);
# Verify Transcript cache is not leaky
my $transcripts = $gene->get_all_Transcripts;
$count = @$transcripts;
pop @$transcripts;
$transcripts = $gene->get_all_Transcripts;
cmp_ok(scalar @$transcripts, '==', $count, "Gene's transcript cache is not modified by changing transcript lists in caller code");
ok(scalar(@{$gene->get_all_Exons()}) == 3);
$gene = $gene->transform("chromosome");
......
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