Fix duplicated destroy shared memory's lock issue (#514)

And add native symbol node to list head when registering native symbol, so as to lookup developer's registered node firstly when linking.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-02-06 21:05:48 -06:00
committed by GitHub
parent 5947ea492d
commit 1630cb2524
2 changed files with 5 additions and 11 deletions

View File

@ -92,7 +92,6 @@ memories_deinstantiate(WASMModuleInstance *module_inst,
continue;
#endif
#if WASM_ENABLE_SHARED_MEMORY != 0
os_mutex_destroy(&memories[0]->mem_lock);
if (memories[i]->is_shared) {
int32 ref_count =
shared_memory_dec_reference(
@ -104,6 +103,7 @@ memories_deinstantiate(WASMModuleInstance *module_inst,
if (ref_count > 0)
continue;
}
os_mutex_destroy(&memories[i]->mem_lock);
#endif
if (memories[i]->heap_handle) {
mem_allocator_destroy(memories[i]->heap_handle);