Shall I delete the pointer manually in v8::External?

前端 未结 2 1367
闹比i
闹比i 2021-01-13 17:06
Local tpl = ObjectTemplate::New(isolate);
tpl->SetInternalFieldCount(1);
Local ret = tpl->NewInstance();
TestExternal* ex =         


        
      
      
      
2条回答
  •  萌比男神i
    2021-01-13 17:28

    If you expect v8::External to delete an object of type TestExternal for you, then you should somehow let it know that it is managing an object of TestExternal.

    Since this is usually done via class template and v8::External is not declared as a template, my guess is that it probably won't call delete for you and you need to delete the pointer manually.

提交回复
热议问题