We would miss the unload event for the root domain because we reported it just
before freeing the domain, by which time the profiler was detached.
g_slist_free (domain->domain_assemblies);
domain->domain_assemblies = NULL;
- /*
- * Send this after the assemblies have been unloaded and the domain is still in a
- * usable state.
- */
- mono_profiler_appdomain_event (domain, MONO_PROFILE_END_UNLOAD);
-
if (free_domain_hook)
free_domain_hook (domain);
mono_gc_finalize_threadpool_threads ();
}
+ mono_profiler_appdomain_event (domain, MONO_PROFILE_END_UNLOAD);
+
return TRUE;
}