Closed
Description
node-addon-examples/src/1-getting-started/6_object_wrap/napi/myobject.cc
Lines 103 to 111 in 59cb03a
The code above allocates memory for MyObject via new
(which allocates and calls MyObject::MyObject()
), but I don't see where that memory is ever freed?
Here's the finalizer...
I believe that finalizer code should be like:
MyObject* obj = reinterpret_cast<MyObject*>(nativeObject);
delete obj;
delete
will call MyObject::~MyObject()
AND free the memory
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done