On Wed, Jul 6, 2011 at 4:09 PM, HdcDst <[email protected]> wrote:
> I am using the following C code in my Program:
>
> 1:      HandleScope handle_scope;
> 2:      Handle<ObjectTemplate> global = ObjectTemplate::New();
> 3:      Handle<ObjectTemplate> point_templ = ObjectTemplate::New();
> 4:      point_templ->SetInternalFieldCount(1);
> 5:      point_templ->SetAccessor(String::New("x"), Point::GetPointX,
> 6:      Point::SetPointX);
> 7:      point_templ->SetAccessor(String::New("y"), Point::GetPointY,
> 8:      Point::SetPointY);
> 9:      Point *p = new Point(3,4);
> 10:     Local<Object> obj = point_templ->NewInstance();
> 11:     obj->SetInternalField(0, External::New(p));
>
> But when at line 10: "Local<Object> obj = point_templ-
>>NewInstance();"
> The Program stops with a memory access error.
> Does anyone has an Idea, what's wrong in my code?
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users

Some relevant context is missing from your example.
So I can only guess: are you executing within a Context::Scope?
What is the point of "global"? It smells as if you meant to
instantiate a context.

You may want to build against the v8 debug version; it may give better
errors (http://code.google.com/apis/v8/build.html).

Matthias

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

Reply via email to