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

Remove finalizer of JavascriptFunction #92

Closed
wants to merge 1 commit into from

Conversation

spahnke
Copy link
Collaborator

@spahnke spahnke commented Nov 4, 2020

The finalizer of JavascriptFunction can lead to System.AccessViolationExceptions if an object of this type is disposed manually. This PR removes it.

Resolves #90

@spahnke
Copy link
Collaborator Author

spahnke commented Apr 7, 2021

The finalizer only leads to problems if the JavascriptContext is disposed but JavascriptFunction objects that were created in that context are not disposed manually by calling the Dispose method (which executes ~JavascriptFunction), but collected by the garbage collector (which executes !JavascriptFunction when the original JavascriptContext is already gone). So the assumption in this PR is wrong which is why I will close it. We're currently testing several improvements regarding the memory footprint. When those are ready and sufficiently tested I will open a new PR with a proper fix for this.

In the meantime: either dispose all of your JavascriptFunction objects manually, or remove the finalizer in your fork temporarily.

@spahnke spahnke closed this Apr 7, 2021
@spahnke spahnke deleted the remove-finalizer branch April 7, 2021 14:16
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.

System.AccessViolationException
1 participant