I'm using new rather than malloc() in my C++ module. When I went to add a custom 'finalizer', it was giving:
napi-inl.h(156): error C2197: 'Finalizer': too many arguments for call
Looking at that line given, it turns out that the finalizer requires you accept an Napi::Env variable first and then the data you initially gave which is contrary to the documentation here:
It must implement operator(), accept a T* (which is the external data pointer), and return void.
I'm not sure which is right here. I don't have any need for the Napi::Env variable and can't think of any reason to use it. Also, it would appear ArrayBuffer has similar documentation issues anything that accepts a finalizer has similar documentation issues.
I'm using
newrather thanmalloc()in my C++ module. When I went to add a custom 'finalizer', it was giving:Looking at that line given, it turns out that the finalizer requires you accept an Napi::Env variable first and then the data you initially gave which is contrary to the documentation here:
I'm not sure which is right here. I don't have any need for the Napi::Env variable and can't think of any reason to use it. Also, it would appear
ArrayBuffer has similar documentation issuesanything that accepts a finalizer has similar documentation issues.