v8::Local<v8::Function> myFunc = v8::Function::New(
i->GetCurrentContext(),
FunctionInvokerCallback(),
this->WrapDelegate(callbackInvoke),
0,
v8::ConstructorBehavior::kThrow,
v8::SideEffectType::kHasSideEffect).ToLocalChecked();
//persistentObject is a weak Global reference with a callback to clean up native resources
this->objectHandle->persistentObject->Get(i)->Set(i->GetCurrentContext(), functionName, myFunc).FromJust();
My guess is that it's because everything is created on one Context...but I'm not sure how to resolve this.Ideally I'd be able to generalize my functions and create a few FunctionTemplates, but in the meantime ti would be great to clean up these functions somehow
--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/9c815ba7-821f-4337-9e46-ec6c439977ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
v8::Global<v8::Object>* persistentObject;...this->objectHandle->persistentObject = new v8::Global<v8::Object>(i, obj);this->objectHandle->persistentObject->SetWeak(this, imWeak, v8::WeakCallbackType::kParameter);--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/8f3fe00c-8c15-4e6c-bf49-87417687d9fd%40googlegroups.com.
f = function() { //do something }
....
f = null;
function foo() { customCallback('foo'); return 'foo'; }
function bar() { return 'bar'; }while (true) {
auto ctx = v8::Context::New(pIsolate, nullptr, GetIsolateData(pIsolate).m_GlobalTemplate.Get(pIsolate)); // IsolateData - Embedded struct; m_GlobalTemplate = v8::Persistent<v8::ObjectTemplate>
auto scr = UnboundScript->BindToCurrentContext();
auto res = scr->Run(ctx);
// Executing functions from ctx->Global and manipulating with results
} // ctx is destroyed each cycle, but v8::heap increasing each cycle too up to OOM exception