From 8b710b28abf490ed5723392c0317335bd70c7658 Mon Sep 17 00:00:00 2001 From: Edy Silva Date: Tue, 12 Nov 2024 09:48:53 -0300 Subject: [PATCH] lib: settle signals when abortcontroller is GCed --- lib/internal/abort_controller.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/internal/abort_controller.js b/lib/internal/abort_controller.js index b812f588c23e99..7d5be777c4560c 100644 --- a/lib/internal/abort_controller.js +++ b/lib/internal/abort_controller.js @@ -84,6 +84,12 @@ function lazyMessageChannel() { } const clearTimeoutRegistry = new SafeFinalizationRegistry(clearTimeout); +const abortControllerSignalFinalizer = new SafeFinalizationRegistry(({ dependantSignals }) => { + // WIP on https://docs.google.com/document/d/1LvmsBLV85p-PhSGvTH-YwgD6onuhh1VXLg8jPlH32H4/edit?pli=1&tab=t.0#heading=h.7ut6obnf9fz0 + // Remove ac.signal from composed signals + // If not source signal remains in the composed signal, let it be GCed +}); + const dependantSignalsCleanupRegistry = new SafeFinalizationRegistry((signalWeakRef) => { const signal = signalWeakRef.deref(); if (signal === undefined) {