> unfortuanatly, when i have allocated and deallocated about 160000
> objects, my program crashes. it looks like the GarbageCollector isn't
> freeing the Persistent Object after calling theMakeWeak-callback.
>
> in my callback i only delete my c++ object, do i have to do something
> with the Persistent<Object> ?

Yes.  The garbage collector intentionally does not dispose the
persistent handle, you have to do that yourself.  It also does not
collect the javascript object, since it is being kept alive by the
handle.  The reason for this is that it gives you the option to keep
the object alive after you get the callback, which is necessary under
some circumstances.  Only if you dispose the handle, and there are no
more persistent handles to the object, does it actually get collected.

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to