Uh oh!
There was an error while loading. Please reload this page.
n-api: keep napi_env alive while it has finalizers - #31140
Conversation
Manage the napi_env refcount from Finalizer instances, as the finalizer may refer to the napi_env until it is deleted. Fixes: nodejs#31134Fixes: node-ffi-napi/node-ffi-napi#48
nodejs-github-bot
commented
Dec 30, 2019
nodejs-github-bot
commented
Dec 30, 2019
legendecas
commented
Jan 2, 2020
Just out of curiosity, why wrapped objects by |
addaleax
commented
Jan 2, 2020
@legendecas Because those finalizers are called during the destruction of |
nodejs-github-bot
commented
Jan 2, 2020
Uh oh!
There was an error while loading. Please reload this page.
legendecas
commented
Jan 3, 2020
Yeah, there are two lists tracking these references. Wondering if it is possible to track those array buffers in the list too? |
addaleax
commented
Jan 3, 2020
Well … In an ideal world, I think it would have been cleaner and more consistent for N-API not to just blindly wrap the Node.js C++ However, the way things currently work is that the N-API methods for dealing with buffers correspond to the C++ The only way “out” of this that I could see is to try and implement the N-API buffer methods in terms of the regular N-API typed array methods – feel free to do that if you like, but it seems like that’s out of scope for this PR. |
nodejs-github-bot
commented
Jan 3, 2020
addaleax
commented
Jan 4, 2020
Landed in 493faf6 |
Manage the napi_env refcount from Finalizer instances, as the finalizer may refer to the napi_env until it is deleted. Fixes: #31134Fixes: node-ffi-napi/node-ffi-napi#48 PR-URL: #31140 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Manage the napi_env refcount from Finalizer instances, as the finalizer may refer to the napi_env until it is deleted. Fixes: #31134Fixes: node-ffi-napi/node-ffi-napi#48 PR-URL: #31140 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Manage the napi_env refcount from Finalizer instances, as the finalizer may refer to the napi_env until it is deleted. Fixes: #31134Fixes: node-ffi-napi/node-ffi-napi#48 PR-URL: #31140 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Manage the napi_env refcount from Finalizer instances, as the finalizer may refer to the napi_env until it is deleted. Fixes: #31134Fixes: node-ffi-napi/node-ffi-napi#48 PR-URL: #31140 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Manage the napi_env refcount from Finalizer instances, as the
finalizer may refer to the napi_env until it is deleted.
Fixes: #31134
Fixes: node-ffi-napi/node-ffi-napi#48
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes