domain->jit_info_table = jit_info_table_new (domain);
domain->jit_info_free_queue = NULL;
domain->finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
+#ifndef HAVE_SGEN_GC
domain->track_resurrection_handles_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
+#endif
InitializeCriticalSection (&domain->lock);
InitializeCriticalSection (&domain->assemblies_lock);
{
MonoThread *thread;
+ if (mono_domain_get () == domain)
+ return;
+
SET_APPDOMAIN (domain);
SET_APPCONTEXT (domain->default_context);
mono_debug_domain_unload (domain);
+ mono_gc_clear_domain (domain);
+
mono_appdomains_lock ();
appdomains_list [domain->domain_id] = NULL;
mono_appdomains_unlock ();
}
g_hash_table_destroy (domain->finalizable_objects_hash);
domain->finalizable_objects_hash = NULL;
+#ifndef HAVE_SGEN_GC
if (domain->track_resurrection_objects_hash) {
g_hash_table_foreach (domain->track_resurrection_objects_hash, free_slist, NULL);
g_hash_table_destroy (domain->track_resurrection_objects_hash);
}
if (domain->track_resurrection_handles_hash)
g_hash_table_destroy (domain->track_resurrection_handles_hash);
+#endif
if (domain->method_rgctx_hash) {
g_hash_table_destroy (domain->method_rgctx_hash);
domain->method_rgctx_hash = NULL;