I'm building an addon for node.js thanks to the node-addon-api.
Each of my 'traditionals' C++ classes is wrapping a C object. Then my Napi::ObjectWrap classes wrap these C++ objects.
my_object -> MyObject -> Napi::ObjectWrap<MyObjectWrapper>
The MyObjectWrapper instance contains a reference to a MyObject instance, that contains a reference to a my_object instance. As, the C object needs to be freed, I was thinking the destructor of MyObject would do the job, but it's never called by the wrapper.
I'm fairly new to node-addon-api and I'm not sure to understand the garbage collector like needed.
What I would like to know is when and how the wrapper is destroyed, and if passing null to the object on the Javascript side has any effect. Any clue on this would be highly appreciated.