Question of interest: Why use a Persistent handle if it's going to be deleted at some point other than process termination?
- Simon 2008/9/29 bell <[EMAIL PROTECTED]>: > > can you tell me, how to delete the Persistent-handle? can i do this in > the callback? I tried obj.Dispose() obj.Clear() and obj.ClearWeak(), > but nothing changed the behaviour. > > > On 28 Sep., 21:40, "Christian Plesner Hansen" > <[EMAIL PROTECTED]> wrote: >> > 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 -~----------~----~----~----~------~----~------~--~---
