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

Cannot release a Weak object #347

Open
irbull opened this issue Sep 12, 2017 · 1 comment · May be fixed by #448
Open

Cannot release a Weak object #347

irbull opened this issue Sep 12, 2017 · 1 comment · May be fixed by #448

Comments

@irbull
Copy link
Member

irbull commented Sep 12, 2017

If an object is setWeak, if we call release on this object, the reference count goes to -1.

@irbull
Copy link
Member Author

irbull commented Jan 15, 2019

Here is a test case that demonstrates this:

    @Test
    public void testReleaseWeakObjectDoesNotAffectReferenceCount() {
        new V8Object(v8).setWeak().close();

        assertEquals(0, v8.getObjectReferenceCount());
    }

ahmadov pushed a commit that referenced this issue Jan 18, 2019
V8 uses another array called v8WeakReferences to keep the weak objects
and this array is used to get object reference count.
Thus, when weak object is released it should also be removed from
v8WeakReferences array.

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

Successfully merging a pull request may close this issue.

1 participant