Closed R2D221 closed 3 years ago
Forgot to close this, but this has been fixed. Refer to the test in WebView2.DOM.Tests.UnitTests.ObjectPersistentInCsharpDoesntKillJsReference (there's a similar one for the opposite case, ObjectPersistentInJsDoesntKillCsharpReference)
If you create a JS object (say, via
document.createElement()
), but don't actually attach it to the document, only keeping a C# reference, the reference can become null in the JS side since we hold it in a weak reference dictionary.The possible solution is to instead hold the weak reference dictionary in the C# side.