Skip to content

Commit 81cb14b

Browse files
FlarnaBethGriggs
authored andcommittedSep 21, 2021
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 <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 0df47d5 commit 81cb14b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎doc/api/addons.md

+4
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)
Please sign in to comment.