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:
@@ -44,8 +44,9 @@ public class Builder {
|
||||
This will only work if the user is an admin on windows.
|
||||
*/
|
||||
file.setWritable(true);//just in case relative path was used.
|
||||
RandomAccessFile raf = new RandomAccessFile(file, "rw");
|
||||
raf.close();//allows closing the file access on windows. forcing to close access. Only works for admin-access.
|
||||
try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
|
||||
//allows closing the file access on windows. forcing to close access. Only works for admin-access.
|
||||
}
|
||||
}
|
||||
|
||||
//file.delete(); //isnt guaranteed on windows.
|
||||
|
||||
Reference in New Issue
Block a user