On Fri, Jan 8, 2016 at 7:59 PM, Sergey F. <[email protected]> wrote:
> I have v8 integration which allocates some objects on c++ side, wraps them
> and makes available to js code
> Everything works perfect, when object becomes unreachable v8 GC calls
> SetWeak callback and I'm able to free c++ allocated memory
>
> But when I do context disposal(via calling persistent handle .Reset()
> method) why the remaining SetWeak callbacks aren't being triggered by v8?
> Should I do this cleanup manually?
>
> Thanks!

Weak callbacks are not guaranteed to run, so yes, you need to clean up manually.

If your persistent handles have a class id, you can iterate over them
with v8::Isolate::VisitHandlesWithClassIds() before disposing the
isolate.

For per-context cleanup, you'll have to devise something else.  You
could assign per-context class ids and filter on them but that may not
be very efficient when there are many contexts.

-- 
-- 
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to