GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — n-api: unlink reference during its destructor · nodejs/node@88aa4e0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • js_native_api_v8.cc
  • test/node-api/test_worker_terminate_finalization
    • test.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/js_native_api_v8.cc‎

Copy file name to clipboardExpand all lines: src/js_native_api_v8.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ class RefBase : protected Finalizer, RefTracker {
220220
finalize_hint);
221221
}
222222

223+
virtual ~RefBase() { Unlink(); }
224+
223225
inline void* Data() {
224226
return _finalize_data;
225227
}
@@ -240,7 +242,6 @@ class RefBase : protected Finalizer, RefTracker {
240242
// the finalizer and _delete_self is set. In this case we
241243
// know we need to do the deletion so just do it.
242244
static inline void Delete(RefBase* reference) {
243-
reference->Unlink();
244245
if ((reference->RefCount() != 0) ||
245246
(reference->_delete_self) ||
246247
(reference->_finalize_ran)) {
Collapse file

‎test/node-api/test_worker_terminate_finalization/test.js‎

Copy file name to clipboardExpand all lines: test/node-api/test_worker_terminate_finalization/test.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
'use strict';
22
const common = require('../../common');
33

4-
// TODO(addaleax): Run this test once it stops failing under ASAN/valgrind.
54
// Refs: https://github.com/nodejs/node/issues/34731
65
// Refs: https://github.com/nodejs/node/pull/35777
76
// Refs: https://github.com/nodejs/node/issues/35778
8-
common.skip('Reference management in N-API leaks memory');
97

108
const { Worker, isMainThread } = require('worker_threads');
119

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.