mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-13 05:01:13 +00:00
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:
parent
e1ea15d94e
commit
1a88104160
|
@ -163,6 +163,7 @@ void
|
||||||
wasi_nn_destroy(wasm_module_inst_t instance)
|
wasi_nn_destroy(wasm_module_inst_t instance)
|
||||||
{
|
{
|
||||||
WASINNContext *wasi_nn_ctx = wasm_runtime_get_wasi_nn_ctx(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);
|
wasi_nn_ctx_destroy(wasi_nn_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user