raszi / node-tmp

Temporary file and directory creator for node.js
MIT License
736 stars 92 forks source link

fix: garbage collector #98

Closed Ari-H closed 7 years ago

Ari-H commented 7 years ago

Changed the way how _removeObjects is being looped in function _garbageCollector, each function in the array should be called once (keeping in mind the fact that the function itself modifies _removeObjects array).

Writing a test case for reproducing the problem, and checking the correct behavior is somewhat difficult, because the carbage collection is being run only at process exit. No test cases were added/changed, because that would require significant changes to how the test cases are being run.

Fixes #97

raszi commented 7 years ago

Thank you!