当前位置: 首页>>代码示例>>C++>>正文


C++ Persistent::Clear方法代码示例

本文整理汇总了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();
}
开发者ID:civildisorder,项目名称:Nova,代码行数:7,代码来源:NovaNode.cpp

示例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();
}
开发者ID:ChrisCinelli,项目名称:native-android,代码行数:8,代码来源:js_timestep_image_map.cpp

示例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;
  }
}
开发者ID:Cythnk,项目名称:territory_mapper,代码行数:9,代码来源:v8_weakref.cpp

示例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();
		}
	}
开发者ID:pgmsoul,项目名称:GitLib,代码行数:10,代码来源:v8base.cpp

示例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;
}
开发者ID:edumunoz,项目名称:MiXture,代码行数:11,代码来源:v8_helper.cpp

示例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();
  }
开发者ID:brainshave,项目名称:v8cl,代码行数:16,代码来源:callbacks.cpp

示例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;
  }
开发者ID:brainshave,项目名称:v8cl,代码行数:19,代码来源:callbacks.cpp

示例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;
  }
}
开发者ID:BlitzMaxModules,项目名称:axe.mod,代码行数:24,代码来源:d8-readline.cpp

示例9: DestroyQuaternionTemplate

void DestroyQuaternionTemplate() {
    QuaternionConstructorTemplate.Clear();
}
开发者ID:LittleForker,项目名称:sirikata,代码行数:3,代码来源:JSQuaternion.cpp


注:本文中的Persistent::Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。