Nevermind, I found my mistake.

I was capturing the handle inside a lambda expression. Usually it works 
because most of my "handles" are pointers to persistent values, this one 
was not. At some point it was just too easy to do [handle]() { ... code ... 
} and it kinda worked "sometimes". Sloppy code.

Anyway, Ben, thanks for your attention to this.

On Friday, April 12, 2019 at 5:32:45 PM UTC+3, Al Mo wrote:
>
> On some place in my code I get a reference to a local v8::Function like 
> this:
>
> v8::Persistent<v8::Value>& VALUE;
>
> v8::Local<v8::Function> FUNCTION = v8::Local<v8::Function>::Cast(VALUE);
>
> Then I call it like: 
>
> FUNCTION->Call(v8::Undefined(this->isolate), 0, NULL);
>
> "0" and "NULL" since I don't need args at this moment.
>
> For some reason, I can only call it once (the callback gets called once on 
> my JS code).
>
> If I call it more than one time, like:
>
> FUNCTION->Call(v8::Undefined(this->isolate), 0, NULL);
> FUNCTION->Call(v8::Undefined(this->isolate), 0, NULL);
> FUNCTION->Call(v8::Undefined(this->isolate), 0, NULL);
> FUNCTION->Call(v8::Undefined(this->isolate), 0, NULL);
>
> Only the first calls suceeds, the other ones do not throw an error but 
> also "do nothing". After this, my stack is corrupted.
>
> Is there something I don't know about the calling convention that could 
> explain this? (Perhaps a function instance is meant to only be called one?)
>
> Or should I dive into my code as I may be the one causing the problem ... ?
>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to