Fix a bug that could prevent temporary files from being deleted on ScanResult::close
on Windows (#288, thanks to @torstenkuhnhenne for the detailed bug report).
Problem background: The JRE cannot delete files on Windows if the files are mmap'd, and mmap'd files cannot be un-mmap'd until their corresponding MappedByteBuffer
instance is garbage collected. For temporary files to be deleted, ClassGraph has to drop all MappedByteBuffer
references and then call System.gc()
to force the MappedByteBuffer
instances to be garbage collected (to un-mmap the files) before tempFile.delete()
can be called on temporary files.