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
We need to be able to remove a wrap previously applied with napi_wrap().
Observations:
For this to work we need to store the Reference in the External, not the void* because the Reference may be self-destroying or it may not be. Either way, we need to have the Reference for when somebody calls napi_remove_wrap().
We need to document that, if the reference was explicitly requested by calling napi_wrap() with a non-NULL result out-parameter then the reference will become invalid after a call to napi_remove_wrap().
Additionally the implementations of napi_remove_wrap() needs to convert a self-destroying Reference into a non-self-destroying one before destroying it and foremost of all we need to remove the weak reference so the void* explicitly detached from the object prototype does not get double-freed.
The text was updated successfully, but these errors were encountered:
We need to be able to remove a wrap previously applied with
napi_wrap()
.Observations:
For this to work we need to store the
Reference
in theExternal
, not thevoid*
because theReference
may be self-destroying or it may not be. Either way, we need to have theReference
for when somebody callsnapi_remove_wrap()
.We need to document that, if the reference was explicitly requested by calling
napi_wrap()
with a non-NULLresult
out-parameter then the reference will become invalid after a call tonapi_remove_wrap()
.Additionally the implementations of
napi_remove_wrap()
needs to convert a self-destroyingReference
into a non-self-destroying one before destroying it and foremost of all we need to remove the weak reference so thevoid*
explicitly detached from the object prototype does not get double-freed.The text was updated successfully, but these errors were encountered: