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