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
This commit is contained in:
Christoph Goller 2004-04-20 18:21:06 +00:00
parent 1bbe8a9361
commit 8256d94f56
1 changed files with 4 additions and 1 deletions

View File

@ -573,7 +573,10 @@ public abstract class IndexReader {
* @throws IOException if there is a problem with accessing the index * @throws IOException if there is a problem with accessing the index
*/ */
public static boolean isLocked(String directory) throws IOException { 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;
} }
/** /**