mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
process.finalization.register() and registerBeforeExit() now return a function that removes only that registration, leaving other registrations for the same object in place. The function does not hold a strong reference to the object. Each registration now uses its WeakRef as the unregister token, which also makes process.finalization.unregister() remove the entries from the FinalizationRegistry; previously it passed the object as the token, which was never registered, so the call had no effect. Refs: https://github.com/nodejs/node/pull/66482 Signed-off-by: Matteo Collina <matteo.collina@gmail.com> Assisted-by: pi PR-URL: https://github.com/nodejs/node/pull/66482 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>