From 88df9e0c5516d28d728fff87000bfb4aa312994e Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Wed, 5 Sep 2012 12:12:29 +0000
Subject: [PATCH] The old way was possibly the WORST way to blank a LRU cache
 by replacing it for a bare hash. Possible memory leak fixed ...

---
 modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
index 90d383643c..b5e8da171b 100644
--- a/modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
@@ -1771,13 +1771,14 @@ sub seq_ids_to_regions {
 sub delete_cache{
   my ($self) = @_;
 
-  $self->{'sr_name_cache'}     = {};
-  $self->{'sr_id_cache'}       = {};
+  %{$self->{'sr_name_cache'}}     = ();
+  %{$self->{'sr_id_cache'}}       = ();
 
   foreach my $key (keys %{$self->{'_asm_mapper_cache'}}){
     $self->{'_asm_mapper_cache'}->{$key}->flush();
   }
-  $self->{'_asm_mapper_cache'} = {};
+  %{$self->{'_asm_mapper_cache'}} = ();
+  return;
 }
 
 
-- 
GitLab