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.
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