Skip to content

[browser][wasm] Implement JavaScript managed object reference counting  #37151

@kjpou1

Description

@kjpou1

The current implementation of the InteropServices.JavaScript framework creates a handle to each managed JavaScript object using the GCHandle.Alloc method, which prevents the managed object from being collected. This leads to the developers code being sprinkled with calling Dispose directly or the 'using' construct so that the JavaScript manage objects can be disposed.

The InteropServices.JavaScript should be modified to implement reference counting to facilitate the correct object collection.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions