Status: New
Owner: ----

New issue 1332 by [email protected]: Initializing a Persisten with a Local is not checked/converted correctly.
http://code.google.com/p/v8/issues/detail?id=1332

Revision 7640.

Spent half my day tracking this down.

Initializing a Persistent handle directly with a Local handle does not check/convert right. If I dispose of the "Persistent" handle I created, V8 crashes when I later try to create other Persistent handles.


To reproduce:

#include <iostream>
#include <v8.h>
using namespace v8;

int main() {
    std::cout<<"Using V8 version: " << V8::GetVersion() <<"\n";

    HandleScope hs;

    //This works fine:
    //Persistent<Number> a = Persistent<Number>::New(Number::New(1));
    //a.Dispose();

    //Doing this will cause a crash below
    Persistent<Number> a(Number::New(1));
    a.Dispose();

    Persistent<Number> b = Persistent<Number>::New(Number::New(1));

    std::cout<<"Survived!\n";
}

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

Reply via email to