Exposes Module.IsClosed to prevent calling functions when closed (#1573)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-07-10 15:32:51 +08:00
committed by GitHub
parent 15fa5c4de5
commit 326c267726
6 changed files with 83 additions and 35 deletions

View File

@@ -320,7 +320,8 @@ func (r *runtime) InstantiateModule(
return
}
// Attach the code closer so that anything afterwards closes the compiled code when closing the module.
// Attach the code closer so that anything afterward closes the compiled
// code when closing the module.
if code.closeWithModule {
mod.(*wasm.ModuleInstance).CodeCloser = code
}