On Tue, Jul 18, 2017 at 7:08 AM, Jane Chen <jxche...@gmail.com> wrote:
> So that was the culprit which caused the crash.  Now I ensure only the
> owning thread resets the weak handles.
>
> A question remains: why does a weak handle have to be reset?  Isn't the idea
> of being weak so that it can be forgotten and cleaned up as part of garbage
> collections?  I get memory corruption when leaving a weak handle un-reset.
> Why is that?

V8 has a concept of reviving a near death weak handle.  Calling
.Reset() in the weak callback tells V8 that it's actually dead.
Calling .ClearWeak() is the other option and informs V8 that the
handle is still alive.

-- 
-- 
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