-
-
Couldn't load subscription status.
- Fork 488
Closed
Labels
Description
- I see that
SuppressDestructoris used often in the object wrap examples, like:
https://github.com/nodejs/node-addon-api/blob/master/doc/object_wrap.md
// Call the SuppressDestruct() method on the static data prevent the calling
// to this destructor to reset the reference when the environment is no longer
// available.
constructor.SuppressDestruct();
But what exactly means this comment? I honestly don't understand if I have to manage the life cycle of any object created by this code.
2. Similarly if using a Napi::FunctionReference created with Napi::Persistent() and assigned to a class member to call a JS callback at any point in time, should the code take care of dereferencing it at some point?
https://github.com/nodejs/node-addon-api/blob/master/doc/function_reference.md