Remove module instance from hashmap in wasi_nn_destroy (#2613)
When destroying wasi-nn context, module instance should be also removed from hashmap to avoid memory leak.
This commit is contained in:
@ -163,6 +163,7 @@ void
|
||||
wasi_nn_destroy(wasm_module_inst_t instance)
|
||||
{
|
||||
WASINNContext *wasi_nn_ctx = wasm_runtime_get_wasi_nn_ctx(instance);
|
||||
bh_hash_map_remove(hashmap, (void *)instance, NULL, NULL);
|
||||
wasi_nn_ctx_destroy(wasi_nn_ctx);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user