Skip to content

Commit 7b4e6d4

Browse files
Flarnanodejs-github-bot
authored andcommitted
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: #40074 Fixes: #38816 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8468bdb commit 7b4e6d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/addons.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,10 @@ provided by the underlying V8 JavaScript engine. They are subject to change
965965
or removal at any time. They are not documented by Node.js or V8, and they
966966
should never be used outside of testing.
967967

968+
During shutdown of the process or worker threads destructors are not called
969+
by the JS engine. Therefore it's the responsibility of the user to track
970+
these objects and ensure proper destruction to avoid resource leaks.
971+
968972
### Factory of wrapped objects
969973

970974
Alternatively, it is possible to use a factory pattern to avoid explicitly

0 commit comments

Comments
 (0)