Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6b8892a

Browse files
authoredMar 25, 2022
doc: clarify ObjectWrap weak ref behavior
Refs: nodejs/node#42461 We currently defer finalizer callbacks until the loop is idle. Warn users that the weak reference on ObjectWraps isn't guaranteed to be valid just because the object hasn't been finalized (destructed) yet.
1 parent 0127496 commit 6b8892a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎doc/object_wrap.md

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ be directly invoked from JavaScript. The **wrap** word refers to a way of
1616
grouping methods and state of the class because it will be necessary write
1717
custom code to bridge each of your C++ class methods.
1818

19+
**Caution:** When the JavaScript object is garbage collected, the call to the
20+
C++ destructor may be deferred until a later time. Within that period,
21+
`Value()` will return an empty value.
22+
1923
## Example
2024

2125
```cpp

0 commit comments

Comments
 (0)
Please sign in to comment.