Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement custom notification on weak reference garbage-collection #425

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

camilleoudot
Copy link

In our application, we need to be notified when some specific V8Value references that have been made weak are garbage-collected by V8, so that we can release some associated object references in the java world too.

This patch adds the ability to optionally set a custom observer on any weak reference. The custom handler is memorized in the V8.v8WeakReferences map, and not as a property of the V8Value, to avoid the cost of an extra field for all the V8Value objects.

@whoozle
Copy link

whoozle commented Jul 3, 2020

any chance of merging it? we need it too 😢 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants