Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/js-native-api/test_reference_double_free/test.js

12 lines
300 B
JavaScript
Raw Permalink Normal View History

node-api: force env shutdown deferring behavior The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: https://github.com/nodejs/node/issues/37236 Co-authored-by: Chengzhong Wu <legendecas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37303 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-02-09 22:52:54 -08:00
'use strict';
// This test makes no assertions. It tests a fix without which it will crash
// with a double free.
const { buildType } = require('../../common');
const addon = require(`./build/${buildType}/test_reference_double_free`);
{ new addon.MyObject(true); }
{ new addon.MyObject(false); }
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 1195ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API