Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MakeWeak(void* parameters, WeakReferenceCallback callback);
- typedef void (*WeakReferenceCallback)(Persistent<Object> object,
- void* parameter);
- void CleanupV8Point(Persistent<Object> object, void*)
- {
- // do whatever cleanup on object that you're looking for
- object.destroyCppObjects();
- }
- Parameter<ObjectTemplate> my_obj(ObjectTemplate::New());
- // when the Javascript part of my_obj is about to be collected
- // we'll have V8 call CleanupV8Point(my_obj)
- my_obj.MakeWeak(NULL, &CleanupV8Point);
Add Comment
Please, Sign In to add comment