-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need wrapper_
?
#140
Comments
This is the extent to which we use node-addon-examples/6_object_wrap/napi/myobject.cc Lines 6 to 11 in dc86a66
and node-addon-examples/6_object_wrap/napi/myobject.cc Lines 72 to 78 in dc86a66
|
Compare with the Nan implementation. The use of the persistent reference may stem from there. If so, it may be a good time to diverge, especially since we document that we discourage storing the |
In fact, none of the Nan examples store a persistent reference to the JS instance. We should remove it. |
Signed-off-by: Gabriel Schulhof <[email protected]> Fixes: nodejs#140
In our ObjectWrap N-API examples we store the
napi_ref
returned fromnapi_wrap()
in the native object instance although we never use it. Tonapi_delete_reference()
in the destructor we need to also store thenapi_env
on the native instance – a practice we discourage.Do we do this for illustration purposes? Can we remove this, since
wrapper_
is not being used anywhere?The text was updated successfully, but these errors were encountered: