From 8256d94f567c832be1e6a8b79aadb7e2cfae7a68 Mon Sep 17 00:00:00 2001 From: Christoph Goller Date: Tue, 20 Apr 2004 18:21:06 +0000 Subject: [PATCH] temporary directory in isLocked(String) was never closed git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150300 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/index/IndexReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/lucene/index/IndexReader.java b/src/java/org/apache/lucene/index/IndexReader.java index 8096ff3a4c8..9a50db715b3 100644 --- a/src/java/org/apache/lucene/index/IndexReader.java +++ b/src/java/org/apache/lucene/index/IndexReader.java @@ -573,7 +573,10 @@ public abstract class IndexReader { * @throws IOException if there is a problem with accessing the index */ public static boolean isLocked(String directory) throws IOException { - return isLocked(FSDirectory.getDirectory(directory, false)); + Directory dir = FSDirectory.getDirectory(directory, false); + boolean result = isLocked(dir); + dir.close(); + return result; } /**