Status: New
Owner: ----
New issue 734 by simon.moles: Creating persistent handle from function
arguments doesn't make object last beyond function scope
http://code.google.com/p/v8/issues/detail?id=734
v8::Handle<v8::Value> DataLoaderManager::HandleData(const v8::Arguments&
args) {
std::cout << "Arg Dump:";
for(int i = 0; i < args.Length(); i++) {
msg << " [" << *v8::String::Utf8Value(args[i]->ToString()) <<
"]";
}
std::cout << std::endl;
v8::Persistent<v8::Object> objHandle =
v8::Persistent<v8::Object>::New(args[0]-
ToObject());
// Some code to send objHandle somewhere else
return v8::Undefined();
}
While the argument dump shows that args[0] is an object, whenever objHandle
is used after this
function scope has ended the program crashes with a bad access signal.
Another user has experienced this here:
http://groups.google.com/group/v8-users/browse_thread/thread/24f1390f8ed7e537
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev