lib: fix timer leak · nodejs/node@515dd24 · GitHub
Skip to content

Commit 515dd24

Browse files
theanarkhtargos
authored andcommitted
lib: fix timer leak
PR-URL: #53337 Fixes: #53335 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Feng Yu <F3n67u@outlook.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
1 parent cf375e7 commit 515dd24

4 files changed

Lines changed: 37 additions & 6 deletions

File tree

lib/internal/timers.js

Lines changed: 12 additions & 0 deletions

lib/timers.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const {
5252
active,
5353
unrefActive,
5454
insert,
55+
knownTimersById,
5556
} = require('internal/timers');
5657
const {
5758
promisify: { custom: customPromisify },
@@ -71,11 +72,6 @@ const {
7172
emitDestroy,
7273
} = require('internal/async_hooks');
7374

74-
// This stores all the known timer async ids to allow users to clearTimeout and
75-
// clearInterval using those ids, to match the spec and the rest of the web
76-
// platform.
77-
const knownTimersById = { __proto__: null };
78-
7975
// Remove a timer. Cancels the timeout and resets the relevant timer properties.
8076
function unenroll(item) {
8177
if (item._destroyed)

test/fixtures/source-map/output/source_map_throw_set_immediate.snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
Error: goodbye
77
at Hello (*uglify-throw-original.js:5:9)
88
at Immediate.<anonymous> (*uglify-throw-original.js:9:3)
9-
at process.processImmediate (node:internal*timers:478:21)
9+
at process.processImmediate (node:internal*timers:483:21)
1010

1111
Node.js *
Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)