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
path: root/doc/api
diff options
context:
space:
mode:
authorGerhard Stöbich <18708370+Flarna@users.noreply.github.com>2021-09-10 21:31:33 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2021-09-15 18:04:13 +0300
commit7b4e6d4772e635670d70433b93f719ab31783598 (patch)
treee28e53695176b1e0f7531adf7abbe4698ef4cf38 /doc/api
parent8468bdbefce8c8a5f93d9181c1b4aec62c583194 (diff)
doc: clarify that ObjectWrap requires manual cleanup on shutdown
Clarify that ObjectWrap instances are not destroyed on process or worker shutdown and require manual destruction to avoid resource leaks. PR-URL: https://github.com/nodejs/node/pull/40074 Fixes: https://github.com/nodejs/node/issues/38816 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/addons.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/api/addons.md b/doc/api/addons.md
index 233fb332f49..78814a97bba 100644
--- a/doc/api/addons.md
+++ b/doc/api/addons.md
@@ -965,6 +965,10 @@ provided by the underlying V8 JavaScript engine. They are subject to change
or removal at any time. They are not documented by Node.js or V8, and they
should never be used outside of testing.
+During shutdown of the process or worker threads destructors are not called
+by the JS engine. Therefore it's the responsibility of the user to track
+these objects and ensure proper destruction to avoid resource leaks.
+
### Factory of wrapped objects
Alternatively, it is possible to use a factory pattern to avoid explicitly