mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
52f9aafeab
A gc may happen during environment teardown. Thus, during finalization initiated by environment teardown we must remove the V8 finalizer before calling the Node-API finalizer. Fixes: https://github.com/nodejs/node/issues/37236 PR-URL: https://github.com/nodejs/node/pull/37616 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
15 lines
284 B
JavaScript
15 lines
284 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc
|
|
|
|
process.env.NODE_TEST_KNOWN_GLOBALS = 0;
|
|
|
|
const common = require('../../common');
|
|
const binding = require(`./build/${common.buildType}/binding`);
|
|
|
|
global.it = new binding.MyObject();
|
|
|
|
global.cleanup = () => {
|
|
delete global.it;
|
|
global.gc();
|
|
};
|