Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-18 01:45:14 +0300
committerAnna Henningsen <anna@addaleax.net>2019-02-22 23:42:09 +0300
commit8ebd339031cf9826629ad780dd35fee130e95985 (patch)
tree6a8a1b59040f55404e3cb3e3cf2860bd4879bd40 /src/node_api.cc
parent455b927be0111a6aa8f1e30ae5b21659afeba40d (diff)
worker: improve integration with native addons
Allow loading add-ons from multiple Node.js instances if they are declared context-aware; in particular, this applies to N-API addons. Also, plug a memory leak that occurred when registering N-API addons. Refs: https://github.com/nodejs/node/pull/23319 PR-URL: https://github.com/nodejs/node/pull/26175 Fixes: https://github.com/nodejs/node/issues/21481 Fixes: https://github.com/nodejs/node/issues/21783 Fixes: https://github.com/nodejs/node/issues/25662 Fixes: https://github.com/nodejs/node/issues/20239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'src/node_api.cc')
-rw-r--r--src/node_api.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_api.cc b/src/node_api.cc
index 4e1a779c42e..bfc0c12aad2 100644
--- a/src/node_api.cc
+++ b/src/node_api.cc
@@ -484,7 +484,7 @@ void napi_module_register_by_symbol(v8::Local<v8::Object> exports,
void napi_module_register(napi_module* mod) {
node::node_module* nm = new node::node_module {
-1,
- mod->nm_flags,
+ mod->nm_flags | NM_F_DELETEME,
nullptr,
mod->nm_filename,
nullptr,