Skip to content

Commit 69d0d98

Browse files
authored
fixup
1 parent 46e41d9 commit 69d0d98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/reference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Holds a counted reference to a [`Napi::Value`](value.md) object; initially a wea
44

55
The referenced `Napi::Value` is not immediately destroyed when the reference count is zero; it is merely then eligible for garbage-collection if there are no other references to the `Napi::Value`.
66

7-
`Napi::Reference` objects allocated in static space, such as a global static instance, must call the `SuppressDestruct` method to prevent its destructor, running at program shutdown time, from attempting to reset the reference when the environment is no longer valid.
7+
`Napi::Reference` objects allocated in static space, such as a global static instance, must call the `SuppressDestruct` method to prevent its destructor, running at program shutdown time, from attempting to reset the reference when the environment is no longer valid. Avoid using this if at all possible.
88

99
The following classes inherit, either directly or indirectly, from `Napi::Reference`:
1010

@@ -109,3 +109,5 @@ void Napi::Reference::SuppressDestruct();
109109
```
110110

111111
Call this method on a `Napi::Reference` that is declared as static data to prevent its destructor, running at program shutdown time, from attempting to reset the reference when the environment is no longer valid.
112+
113+
Avoid using this if at all possible. If you do need to use static data, **MAKE SURE** to warn your users that your addon is **NOT** threadsafe.

0 commit comments

Comments
 (0)