提交 a9e71a03 authored 作者: Andrei Tokar's avatar Andrei Tokar

do not throw ecxeptions from FileStore.close() when it's already closed.

上级 f3801728
......@@ -186,11 +186,10 @@ public class FileStore {
* Close this store.
*/
public void close() {
if(file != null) {
if(file != null && file.isOpen()) {
try {
if (fileLock != null) {
if (fileLock != null && fileLock.isValid()) {
fileLock.release();
fileLock = null;
}
file.close();
freeSpace.clear();
......@@ -199,6 +198,7 @@ public class FileStore {
DataUtils.ERROR_WRITING_FAILED,
"Closing failed for file {0}", fileName, e);
} finally {
fileLock = null;
file = null;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论