This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
Collection of FinalizationGroup objects #66
Closed
Description
With agents keeping a list of all FinalizationGroup
instances on an internal slot, do these get collected when all user references are gone?
Besides the obvious leak, even when [[Cells]]
is empty, it might be surprising for users to get cleanup callbacks after they stopped using their finalization group.
The situation is akin to registering an event listener on an object. If the object is not reachable anymore, I'm not expecting to get my event handler called.
Developers may not go through the trouble of bookkeeping and manually unregistering.
At the very least, I believe a FinalizationGroup instance should only be in agent.[[FinalizationGroups]]
when its cells are not empty.