The handle will exist in the HandleScope supplied by the caller. When that handle scope is destroyed, it will be released (unless the handle is extracted via the HandleScope close). I don't think that this implies the memory consumed by the handle will be immediately collected. This will not happen until sometime in the future when the garbage collector kicks in.
Returning a reference will not work here. The compiler should not let you return a reference to a stack variable. If it did it would likely be corrupted before it is used. Also the function signature would not match that expected for callback functions. Even if you coerced it with a cast, it would still likely do the wrong thing. -- Bryan White --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
