本文整理汇总了C++中Persistent::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Persistent::Clear方法的具体用法?C++ Persistent::Clear怎么用?C++ Persistent::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Persistent
的用法示例。
在下文中一共展示了Persistent::Clear方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoneWithSuspectCallback
void NovaNode::DoneWithSuspectCallback(Persistent<Value> suspect, void *paramater) {
Suspect *s = static_cast<Suspect*>(paramater);
delete s;
suspect.ClearWeak();
suspect.Dispose();
suspect.Clear();
}
示例2: image_map_finalize
static void image_map_finalize(Persistent<Value> ctx, void *param) {
timestep_image_map *map = static_cast<timestep_image_map*>( param );
timestep_image_delete(map);
ctx.Dispose();
ctx.Clear();
}
示例3: v8_weakref_dispose
void v8_weakref_dispose(Persistent<Value> value, void* data) {
value.Dispose();
value.Clear();
v8_weakref* weakref = (v8_weakref*)data;
weakref->v8_active = false;
if (!weakref->rb_active) {
delete weakref;
}
}
示例4: setPersistentFunc
void setPersistentFunc(Persistent<Function>& pf,Handle<Value>& v){
if(v->IsFunction()){
if(!pf.IsEmpty()) pf.Dispose();
pf = Persistent<Function>::New(Handle<Function>::Cast(v));
}else if(v->IsNull()||v->IsUndefined()){
if(pf.IsEmpty()) return;
pf.Dispose();
pf.Clear();
}
}
示例5: disposeHandle
extern "C" void disposeHandle(Persistent<Value> object, void* parameter) {
// cout << "Hello from disposeHandle c++" << endl;
CALLBACK cleanup = reinterpret_cast<CALLBACK>(reinterpret_cast<long>(parameter));
// cout << "After the cast" << endl;
(cleanup)(object);
// cout << "After the call" << endl;
object.Dispose();
// cout << "After the dipose" << endl;
object.Clear();
// cout << "After the clear" << endl;
}
示例6: DisposeOpenCLObject
void DisposeOpenCLObject (Persistent<Value> value, void* release) {
if (release && value->IsObject()) {
Local<Object> object = value->ToObject();
if (object->InternalFieldCount()) {
void *ptr = object->GetPointerFromInternalField(0);
int32_t (CALL *clRelease) (void* smth);
*(void**) &clRelease = release;
clRelease(ptr); // Returned value is omitted. Check when debugging.
}
}
value.Dispose();
value.Clear();
}
示例7: HandleEvent
void HandleEvent (EventHandler* handler) {
if (handler->f->IsFunction()) {
Persistent<Function> f = Persistent<Function>::Cast<Value>(handler->f);
Handle<Value> args[3];
args[0] = handler->event;
args[1] = Int32::New(handler->type);
args[2] = Local<Value>::New(handler->data);
f->Call(f, 3, args);
f.Clear();
}
handler->f.Dispose();
handler->f.Clear();
handler->data.Dispose();
handler->data.Clear();
handler->event.Dispose();
handler->event.Clear();
delete handler;
}
示例8: CompletionGenerator
char* ReadLineEditor::CompletionGenerator(const char* text, int state) {
static unsigned current_index;
static Persistent<Array> current_completions;
if (state == 0) {
i::SmartPointer<char> full_text(i::StrNDup(rl_line_buffer, rl_point));
HandleScope scope;
Handle<Array> completions =
Shell::GetCompletions(String::New(text), String::New(*full_text));
current_completions = Persistent<Array>::New(completions);
current_index = 0;
}
if (current_index < current_completions->Length()) {
HandleScope scope;
Handle<Integer> index = Integer::New(current_index);
Handle<Value> str_obj = current_completions->Get(index);
current_index++;
String::Utf8Value str(str_obj);
return strdup(*str);
} else {
current_completions.Dispose();
current_completions.Clear();
return NULL;
}
}
示例9: DestroyQuaternionTemplate
void DestroyQuaternionTemplate() {
QuaternionConstructorTemplate.Clear();
}