You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The N-API documentation says not to keep napi_env values around. This would seem to imply that napi_env values are valid only for the duration of a single call into native code (the module initializer, a native function call, etc).
However, in the C++ wrapper, the Reference class (which is meant to live longer than a single native call) keeps a long-lived napi_env value around, seemingly violating the documented lifetime!
Please clarify the lifetime of napi_env values in the documentation. Just how long is a napi_envreally valid for? A single native call? The entire time until the env_shutdown_hooks are run and the native module is unloaded? Somewhere in between?
The text was updated successfully, but these errors were encountered:
The N-API documentation says not to keep
napi_env
values around. This would seem to imply thatnapi_env
values are valid only for the duration of a single call into native code (the module initializer, a native function call, etc).However, in the C++ wrapper, the
Reference
class (which is meant to live longer than a single native call) keeps a long-livednapi_env
value around, seemingly violating the documented lifetime!Please clarify the lifetime of
napi_env
values in the documentation. Just how long is anapi_env
really valid for? A single native call? The entire time until theenv_shutdown_hook
s are run and the native module is unloaded? Somewhere in between?The text was updated successfully, but these errors were encountered: