[runtime] Fix some small domain related memory leaks. (#4685)
authorZoltan Varga <vargaz@gmail.com>
Thu, 13 Apr 2017 16:16:24 +0000 (12:16 -0400)
committerGitHub <noreply@github.com>
Thu, 13 Apr 2017 16:16:24 +0000 (12:16 -0400)
mono/mini/mini-runtime.c
mono/mini/seq-points.c

index 7e0e02cfefdcece085e5e2a4685af6d7eba23325..b245e264ce469a57417fe932769a3319ac9e8fa1 100644 (file)
@@ -3641,6 +3641,7 @@ mini_free_jit_domain_info (MonoDomain *domain)
                g_hash_table_foreach (info->llvm_jit_callees, free_jit_callee_list, NULL);
                g_hash_table_destroy (info->llvm_jit_callees);
        }
+       mono_internal_hash_table_destroy (&info->interp_code_hash);
 #ifdef ENABLE_LLVM
        mono_llvm_free_domain_info (domain);
 #endif
index 88f732d9fc350b9e8a6e5b8bda942e9670a3b0c9..8af932a245558b85056f158f6729a71f5df00c0f 100644 (file)
@@ -237,9 +237,11 @@ mono_save_seq_point_info (MonoCompile *cfg)
        // FIXME: dynamic methods
        if (!cfg->compile_aot) {
                mono_domain_lock (domain);
-               // FIXME: How can the lookup succeed ?
+               // FIXME: The lookup can fail if the method is JITted recursively though a type cctor
                if (!g_hash_table_lookup (domain_jit_info (domain)->seq_points, cfg->method_to_register))
                        g_hash_table_insert (domain_jit_info (domain)->seq_points, cfg->method_to_register, cfg->seq_point_info);
+               else
+                       mono_seq_point_info_free (cfg->seq_point_info);
                mono_domain_unlock (domain);
        }