/* ---------------------------------  CJS_Object --------------------------------- */
void  FreeObject(const v8::WeakCallbackData<v8::Object, CJS_Object>& data)
{
	CJS_Object* pJSObj  = data.GetParameter();
	if(pJSObj)
	{
		pJSObj->ExitInstance();
		delete pJSObj;
	}
	v8::Local<v8::Object> obj = data.GetValue();
	JS_FreePrivate(obj);
}
예제 #2
0
    void JSZCluster::weakCallback(const v8::WeakCallbackData<v8::Object, JSZCluster> &data) {

        JSZCluster *This = data.GetParameter();
        Local<Object> value = data.GetValue();

        Local<External> wrap = Local<External>::Cast(value->GetInternalField(1));
        Cluster *cluster = (Cluster *) wrap->Value();

        NwkAddr nwkAddress = cluster->getNetworkAddress();
        EndpointID endpointId = cluster->getEndpoint();
        ClusterID clusterId = cluster->getId();

        Key key(nwkAddress, endpointId, clusterId);

        This->usedCluster.erase(key);
    }
예제 #3
0
static void weakCallback(const v8::WeakCallbackData<v8::Context, ScriptState>& data)
{
    data.GetValue()->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, 0);
    data.GetParameter()->clearContext();
    data.GetParameter()->deref();
}