U
U
unclechu2014-07-27 01:33:46
C++ / C#
unclechu, 2014-07-27 01:33:46

How to reset the value of a V8 variable?

How to set value for V8 variable to undefined ?
Let's say there is a global variable:
Persistent<Function> callback;
How to set it to undefined so that memory is also freed (although I suspect the GC will do this itself).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Snegirev, 2014-07-27
@Rikkit

delete callback;

I
Ivan Starkov, 2014-07-27
@icelaba

Stupidly
obj->Set(v8::String::New("propname"), v8::Undefined());
doesn't roll?
I re-read the question:
In general, Persistent has a method Dispose
callback.Dispose()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question