mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Flush persistence file contents on ChronicleMap.close()
This commit is contained in:
@@ -523,6 +523,13 @@ public abstract class VanillaChronicleHash<K,
|
||||
if (closed)
|
||||
return;
|
||||
closed = true;
|
||||
if (file != null) {
|
||||
try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
|
||||
raf.getChannel().force(true);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
bs = null;
|
||||
file = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user