Skip to content

[browser][mt] Release all proxies of C# and JS objects #86039

@pavelsavara

Description

@pavelsavara

release all those proxies when we detach the worker.

  • for the proxies of objects, we would reset the GCHandle/JSHandle to -1 and if some stray setTimeout callback uses it, we will throw.
  • for the proxies of functions, mark it disposed and it would throw if you try to call it.
  • for the proxies of Task/Promise
  • same for proxies in the other direction.
  • at the end of detach, we should assert that have empty FinalizationRegistry of that worker.
  • at the end of detach, we should assert that s_csOwnedObjects is empty
  • we need a JS callback or event when a pthread detaches
  • the FinalizationRegistry callback invokes managed code, so we need to check when is the last moment when the thread is still attached enough that we can run some managed code.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions