ref-napi
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -749,4 +749,8 @@ 'use strict'; | ||
debug('writing pointer to buffer', buf, offset, ptr); | ||
exports._writePointer(buf, offset, ptr); | ||
exports._attach(buf, ptr); | ||
// Passing true as a fourth parameter does an a stronger | ||
// version of attach which ensures ptr is only collected after | ||
// the finalizer for buf has run. See | ||
// https://github.com/node-ffi-napi/ref-napi/issues/54 | ||
// for why this is necessary | ||
exports._writePointer(buf, offset, ptr, true); | ||
}; | ||
@@ -753,0 +757,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"engines": { | ||
"node": ">= 6.0" | ||
"node": ">= 10.0" | ||
}, | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
], | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"license": "MIT", | ||
@@ -28,0 +28,0 @@ "author": "Anna Henningsen <anna@addaleax.net>", |
@@ -46,8 +46,10 @@ 'use strict'; | ||
setImmediate(() => { | ||
assert(parent_gc, '"parent" has not been garbage collected'); | ||
gc(); | ||
setImmediate(() => { | ||
assert(parent_gc, '"parent" has not been garbage collected'); | ||
gc(); | ||
setImmediate(() => { | ||
assert(child_gc, '"child" has not been garbage collected'); | ||
done(); | ||
setImmediate(() => { | ||
assert(child_gc, '"child" has not been garbage collected'); | ||
done(); | ||
}); | ||
}); | ||
@@ -54,0 +56,0 @@ }); |
@@ -55,6 +55,8 @@ 'use strict'; | ||
setImmediate(() => { | ||
assert(otherGCd, '"other" has not been garbage collected'); | ||
assert(origGCd, '"buf" has not been garbage collected'); | ||
setImmediate(() => { | ||
assert(otherGCd, '"other" has not been garbage collected'); | ||
assert(origGCd, '"buf" has not been garbage collected'); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2410755
3325