Close module correctly in host func example (#445)

Signed-off-by: zhangchao <zchao9100@gmail.com>
This commit is contained in:
Taction
2022-04-06 18:15:26 +08:00
committed by GitHub
parent fb0b311844
commit a05b291836

View File

@@ -76,7 +76,7 @@ func Test_hostFunc(t *testing.T) {
// InstantiateModuleWithConfig runs the "_start" function which is what TinyGo compiles "main" to.
module, err := r.InstantiateModuleWithConfig(code, config)
require.NoError(t, err)
defer wm.Close()
defer module.Close()
allocateInWasmBufferFn := module.ExportedFunction("allocate_buffer")
require.NotNil(t, allocateInWasmBuffer)