In servlet containers and Spring applications, rather than adding a shutdown hook to close any unclosed ScanResult
objects (to prevent resource leaks), instead add an event listener that closes unclosed ScanResult
objects when the container is being torn down. This prevents a leak of the container's classloader (#376, thanks to @vimil for reporting).
Please report any regressions with servlet containers or Spring.