Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix leaking file handles when loading modules
Since commit efadff2 a PrecompilationUnit is marked uninitialized after closing. When we use an accessor like .checksum after closing (by !load-handle-for-path), the precomp file gets reopened and stays that way. When we load multiple modules with a shared dependency, we will detect that dependency is already loaded and not call !load-handle-for-path for it again. Unfortunately we also do not get the side effect of closing the unit this way. Fix by moving the .close call out of !load-handle-for-path, making the program flow more clear and using the accessors before the explicit call to .close.
- Loading branch information