diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala index 1ab66cee1f..c9b7916a93 100644 --- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala +++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala @@ -155,6 +155,12 @@ case class RecordLog(directory: File, logSuffix:String) { onDelete(info.file) onDelete(id) log_infos.remove(id) + reader_cache.synchronized { + val reader = reader_cache.remove(info.file); + if( reader!=null ) { + reader.release(); + } + } } } }