Updates:
        Status: WorkingAsIntended

Comment #7 on issue 3523 by [email protected]: Deadlock after calling IdleNotification(100) or Dispose on isolate
https://code.google.com/p/v8/issues/detail?id=3523

I don't want to wait with the deallocation of my C++ instances

You don't have to. That's what weak callbacks are for. Deallocating C++ objects when you get a weak callback for them is fine. *Relying* on getting that callback before shutdown is wrong.

hope that when it would be necessary V8 would call the garbage collector and until then just ignore [the valgrind reports]

It most certainly will, but the garbage collector can't clean up your C++ objects. The only reason it looks like the GC affects Valgrind's output is because the weak callbacks are creating a connection between otherwise separate systems.

As far as I understand the situation, you should keep your weak callbacks so you can do early cleanup when appropriate, and then you'll need an additional cleanup mechanism, entirely on the C++ side, that cleans up everything before program shutdown, regardless of whether weak callbacks have been fired or not. Roughly:

global list_of_things;

CreateThing() {
  register thing in list_of_things;
  install weak callback on thing;
}

WeakCallback(thing) {
  remove thing from list_of_things;
  clean up resources held by thing;
}

Shutdown() {
  for (thing in list_of_things) {
    clean up resources held by thing;
  }
}

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" 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