wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

C#: do not drop resource handles in finalizers

Open dicej opened this issue 1 year ago • 0 comments

As of this writing, we cannot safely drop a handle to an imported resource from a .NET finalizer because it may still have one or more open child resources. Once WIT has explicit syntax for indicating parent/child relationships, we should be able to use that information to keep track of child resources automatically in generated code, at which point we'll be able to drop them in the correct order from finalizers.

Fixes #1039

dicej avatar Aug 29 '24 00:08 dicej