Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-667: add finalizer to ConcurrentLRUCache in case destroy() is forgotten

Yonik Seeleyd22d850fe855
diff --git a/src/java/org/apache/solr/common/util/ConcurrentLRUCache.java b/src/java/org/apache/solr/common/util/ConcurrentLRUCache.java
index 53b8c2cfae2..ddbf9fa8d8d 100644
--- a/src/java/org/apache/solr/common/util/ConcurrentLRUCache.java
+++ b/src/java/org/apache/solr/common/util/ConcurrentLRUCache.java
@@ -529,4 +529,7 @@ public class ConcurrentLRUCache<K,V> {
}
}
+ protected void finalize() throws Throwable {
+ destroy();
+ }
}