static void WeakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter)
{
    InjectedScriptHost* nativeObject = static_cast<InjectedScriptHost*>(parameter);
    nativeObject->deref();
    object.Dispose();
    object.Clear();
}
void WeakHandleListener<StringCache, StringImpl>::callback(v8::Isolate* isolate, v8::Persistent<v8::Value> wrapper, StringImpl* stringImpl)
{
    V8PerIsolateData::current()->stringCache()->remove(stringImpl);
    wrapper.Dispose(isolate);
    wrapper.Clear();
    stringImpl->deref();
}
Exemple #3
0
static void cachedStringCallback(v8::Persistent<v8::Value> wrapper, void* parameter)
{
    StringImpl* stringImpl = static_cast<StringImpl*>(parameter);
    V8PerIsolateData::current()->stringCache()->remove(stringImpl);
    wrapper.Dispose();
    wrapper.Clear();
    stringImpl->deref();
}
Exemple #4
0
 static inline void MadeWeak(v8::Persistent<v8::Value> object,
                             void                     *parameter)
 {
     T *obj = static_cast<T *>(parameter);
     delete(obj);
     object.Dispose();
     object.Clear();
 }
void SimpleDecWrappedRefCount(Isolate* isolate, v8::Persistent<v8::Value> object, void *parameter){
	SMJS_BaseWrapped *wrapped = (SMJS_BaseWrapped*) parameter;
	if(--wrapped->refCount == 0){
		delete wrapped;
	}

	object.Dispose();
    object.Clear();
}
Exemple #6
0
void
JSFeature::FreeFeatureCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    Feature* feature = static_cast<Feature*>(parameter);
    delete feature;

    object.Dispose();
    object.Clear();
}
void clrFuncProxyNearDeath(v8::Persistent<v8::Value> object, void* parameters)
{
    DBG("clrFuncProxyNearDeath");
    ClrFuncWrap* wrap = (ClrFuncWrap*)parameters;
    object.Dispose();
    object.Clear();
    wrap->clrFunc = nullptr;
    delete wrap;
}
Exemple #8
0
void
JSFeatureProfile::FreeProfileCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    FeatureProfile* profile = static_cast<FeatureProfile*>(parameter);
    delete profile;

    object.Dispose();
    object.Clear();
}
Exemple #9
0
void
JSFilterContext::FreeContextCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    FilterContext* context = static_cast<FilterContext*>(parameter);
    delete context;

    object.Dispose();
    object.Clear();
}
Exemple #10
0
void
JSMapInfo::FreeMapInfoCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    Session* session = static_cast<Session*>(parameter);
    delete session;

    object.Dispose();
    object.Clear();
}
Exemple #11
0
void
JSBounds::FreeBoundsCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    Bounds* bounds = static_cast<Bounds*>(parameter);
    delete bounds;

    object.Dispose();
    object.Clear();
}
Exemple #12
0
void
JSVec3d::FreeVecCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    osg::Vec3d* v = static_cast<osg::Vec3d*>(parameter);
    delete v;

    object.Dispose();
    object.Clear();
}
Exemple #13
0
void
JSSymbologyGeometry::FreeGeometryCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    osgEarth::Symbology::Geometry* geometry = static_cast<osgEarth::Symbology::Geometry*>(parameter);
    delete geometry;

    object.Dispose();
    object.Clear();
}
Exemple #14
0
void
JSGeoExtent::FreeGeoExtentCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    osgEarth::GeoExtent* extent = static_cast<osgEarth::GeoExtent*>(parameter);
    delete extent;

    object.Dispose();
    object.Clear();
}
Exemple #15
0
void
JSSpatialReference::FreeSpatialReferenceCallback(v8::Persistent<v8::Value> object, void *parameter)
{
    //osgEarth::SpatialReference* srs = static_cast<osgEarth::SpatialReference*>(parameter);
    //delete srs;
    osg::ref_ptr<osgEarth::SpatialReference> srs = static_cast<osgEarth::SpatialReference*>(parameter);

    object.Dispose();
    object.Clear();
}
Exemple #16
0
void ObjectCache<K>::WeakCallback(v8::Persistent<v8::Value> object, void *parameter) {
  //called when only reference to object is weak - after garbage collection
  CallbackParameters<K> *params = (CallbackParameters<K>*) parameter;

  //remove it from the map
  params->cache->erase(params->key);

  //clear the reference to it
  object.Dispose();
  object.Clear();

  free(params);
}
Exemple #17
0
template <class T> inline void ClearPersistent(v8::Persistent<T>& handle) {
  if (handle.IsEmpty()) return;
  handle.Dispose();
  handle.Clear();
}
Exemple #18
0
void WeakHandleListener<DOMWrapperWorld>::callback(v8::Isolate* isolate, v8::Persistent<v8::Value> object, DOMWrapperWorld* world)
{
    object.Dispose(isolate);
    object.Clear();
    world->deref();
}
static void make_weak_callback(v8::Persistent<v8::Value> object, void *parameter) {
	object.Dispose(); // if there is no reference from js, surelly this can be disposed.
	object.Clear();
}
Exemple #20
0
void WeakHandleListener<InjectedScriptManager, InjectedScriptHost>::callback(v8::Isolate* isolate, v8::Persistent<v8::Value> object, InjectedScriptHost* host)
{
    host->deref();
    object.Dispose(isolate);
    object.Clear();
}