mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Add a RandomAccessFile which doesn't resource leak on a GC, https://github.com/OpenHFT/Chronicle-Core/issues/108
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.hash.impl.util;
|
||||
|
||||
import net.openhft.chronicle.core.CleaningRandomAccessFile;
|
||||
import net.openhft.chronicle.core.Jvm;
|
||||
|
||||
import java.io.File;
|
||||
@@ -36,7 +37,7 @@ public final class CanonicalRandomAccessFiles {
|
||||
return canonicalRafs.compute(file, (f, ref) -> {
|
||||
if (ref == null) {
|
||||
try {
|
||||
return new RafReference(new RandomAccessFile(f, "rw"));
|
||||
return new RafReference(new CleaningRandomAccessFile(f, "rw"));
|
||||
} catch (FileNotFoundException e) {
|
||||
throw Jvm.rethrow(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user