nan
nan copied to clipboard
NewInstance memory leak
Nan::HandleScope scope; Local FunctionTemplate tp = Nan::New<FunctionTemplate>(New); tp->SetClassName(Nan::New(ClassName).ToLocalChecked()); tp->InstanceTemplate()->SetInternalFieldCount(1); Local Function cons = tp->GetFunction(); Local Object js; js= Nan::NewInstance(cons, argc, argv).ToLocalChecked(); args.GetReturnValue().Set(js);
Using this method, two