v8: fix missing callback in heap utils destroy

This fixes the v8.getHeapSnapshot() calls not properly being
destroyed. Pipeline calls would for example not properly end
without the callback being in place.

PR-URL: https://github.com/nodejs/node/pull/58846
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Ruben Bridgewater 2025-06-30 13:51:40 +02:00 committed by GitHub
parent ab9ef37aa7
commit c08a1d152b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -53,11 +53,12 @@ class HeapSnapshotStream extends Readable {
this[kHandle].readStart();
}
_destroy() {
_destroy(err, callback) {
// Release the references on the handle so that
// it can be garbage collected.
this[kHandle][owner_symbol] = undefined;
this[kHandle] = undefined;
callback(err);
}
[kUpdateTimer]() {