Open kaivol opened 1 week ago
Seems like a bug, but with wit-bindgen, rather than this tooling, so should be https://github.com/bytecodealliance/wit-bindgen/issues I think
Okay, never mind, this seems to be intended: https://github.com/bytecodealliance/wit-bindgen/commit/c648fc7b84dea32e66f87b760832b7f7a79dd63c
Nevertheless, it might be helpful to mention in the readme that resources must be disposed/dropped manually. Perhaps recommending to enable the corresponding warnings (CA2000, CA1001, CA2213)?
Feel free to close this issue if this is not the correct repository for these suggestions.
You are right, I'd forgotten about the child resources problem.
The warnings look reasonable to turn on, Do you have an example where this triggers?
Not sure the best place to document, but we can certainly add a note the readme here.
Currently, projections for imported resources implement
IDisposable
, but they do not provide afinalizer
. This means that if the user forgets to manually dispose the resource, its[resource-drop]
function is never called.I believe this is incorrect, and the resource should provide a finalizer that calls the resource's
[resource-drop]
function.Version: