mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-11-26 23:42:05 +00:00
Destroy fast-jit compiler after destroy loaded modules (#1402)
Destroy Fast-JIT compiler after destroying the modules loaded by multi-module feature, since the Fast JIT's code cache allocator may be used by these modules. If the Fast JIT's code cache allocator was destroyed, then runtime will fail to destroy these modules. And fix the issue of destroying import module's memory instance.
This commit is contained in:
parent
1fc01fab4b
commit
e15db8d732
|
@ -341,10 +341,6 @@ wasm_runtime_init()
|
|||
void
|
||||
wasm_runtime_destroy()
|
||||
{
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
jit_compiler_destroy();
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
wasm_externref_map_destroy();
|
||||
#endif
|
||||
|
@ -368,6 +364,14 @@ wasm_runtime_destroy()
|
|||
os_mutex_destroy(®istered_module_list_lock);
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_FAST_JIT != 0
|
||||
/* Destroy Fast-JIT compiler after destroying the modules
|
||||
* loaded by multi-module feature, since the Fast JIT's
|
||||
* code cache allocator may be used by these modules.
|
||||
*/
|
||||
jit_compiler_destroy();
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_SHARED_MEMORY
|
||||
wasm_shared_memory_destroy();
|
||||
#endif
|
||||
|
|
|
@ -109,8 +109,11 @@ memories_deinstantiate(WASMModuleInstance *module_inst,
|
|||
for (i = 0; i < count; i++) {
|
||||
if (memories[i]) {
|
||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||
if (i < module_inst->module->import_memory_count)
|
||||
WASMModule *module = module_inst->module;
|
||||
if (i < module->import_memory_count
|
||||
&& module->import_memories[i].u.memory.import_module) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if WASM_ENABLE_SHARED_MEMORY != 0
|
||||
if (memories[i]->is_shared) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user