Skip to content

Implement custom notification on weak reference garbage-collection#425

Open
camilleoudot wants to merge 1 commit intoeclipsesource:masterfrom
camilleoudot:weak_reference_handler
Open

Implement custom notification on weak reference garbage-collection#425
camilleoudot wants to merge 1 commit intoeclipsesource:masterfrom
camilleoudot:weak_reference_handler

Conversation

@camilleoudot
Copy link
Copy Markdown

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

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.

3 participants