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

Local<ObjectTemplate> tpl = ObjectTemplate::New(isolate);
tpl->SetInternalFieldCount(1);
Local<Object> ret = tpl->NewInstance();
TestExternal* ex = new TestExternal();
ret->SetInternalField(0, External::New(isolate, ex));

Is it possible to delete the pointer exmanually if it is retno longer in use?

Where does the source code for the evidence show that I should or should not?

+4
source share
2 answers

, ++ : new, delete, . , , . ( ), " ", .

V8 . v8::External , , - , (a void* ).

V8 Persistent "" , V8 GC , . v8.h :

. ,   . .    , GC -    !

, ++ B., .

+2

, v8::External TestExternal , - , TestExternal.

, v8::External , , , , delete , .

0

Source: https://habr.com/ru/post/1677099/


All Articles