mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
process.finalization only holds weak references to registered objects. In unregister-function.mjs and finalization-cleanup.mjs the registered objects were not captured by any closure, so a GC before exit could collect them, skipping their exit callbacks and failing the assertions. Reference them from the exit listeners so they stay reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011DQrzezHzwzfCYeh2cYm2U Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: https://github.com/nodejs/node/pull/66869 Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>