|
|
@@ -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
|