提交 3bc33d61 authored 作者: Noel Grandin's avatar Noel Grandin

even in-memory MVStore, we need to mark the maps as closed

上级 d999f8d5
......@@ -18,7 +18,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.h2.compress.CompressDeflate;
import org.h2.compress.CompressLZF;
import org.h2.compress.Compressor;
......@@ -889,11 +888,8 @@ public class MVStore {
// could result in a deadlock
stopBackgroundThread();
closed = true;
if (fileStore == null) {
return;
}
synchronized (this) {
if (shrinkIfPossible) {
if (fileStore != null && shrinkIfPossible) {
shrinkFileIfPossible(0);
}
// release memory early - this is important when called
......@@ -906,12 +902,14 @@ public class MVStore {
meta = null;
chunks.clear();
maps.clear();
try {
if (!fileStoreIsProvided) {
fileStore.close();
if (fileStore != null) {
try {
if (!fileStoreIsProvided) {
fileStore.close();
}
} finally {
fileStore = null;
}
} finally {
fileStore = null;
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论