Closed spahnke closed 3 years ago
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.
The finalizer of
JavascriptFunction
can lead toSystem.AccessViolationException
s if an object of this type is disposed manually. This PR removes it.Resolves #90