mono_runtime_shutdown_stat_profiler (void)
{
InterlockedWrite (&sampling_thread_running, 0);
- if (sampling_thread)
- pthread_join (sampling_thread, NULL);
+ pthread_join (sampling_thread, NULL);
/*
* We can't safely remove the signal handler because we have no guarantee
void
mini_cleanup (MonoDomain *domain)
{
- mono_runtime_shutdown_stat_profiler ();
+ if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
+ mono_runtime_shutdown_stat_profiler ();
#ifndef DISABLE_COM
cominterop_release_all_rcws ();