Automatically Close File Handles
Restioson opened this issue ยท 3 comments
In release 1.8.9, if you do not close a file handle, or terminate the program before it has closed the handle, you cannot edit the file. It would be nice it was closed when the program which owns the handle is terminated.
I'd rather people just closed file handles, but I realise bugs happen :). Instead of closing it when the program terminates (which isn't really feasible), it would probably be better to close it when the handle is garbage collected. This could probably be done with a ReferenceQueue
and a weak reference to the IMountedFile
.
This should be fixed in 09215da
Previously, that HashSet was preventing the java GC from collecting lost file handles.