[mini] Shut down the profiler after shutting down the major runtime components.
[mono.git] / mono / mini / mini-runtime.c
index f331f0c083556d2ac50db68b50ebf6139cdfd82f..795bab9e41d319ebb23ec690c14ee6cf6c288980 100644 (file)
@@ -4182,12 +4182,12 @@ mini_cleanup (MonoDomain *domain)
        /* This accesses metadata so needs to be called before runtime shutdown */
        print_jit_stats ();
 
-       mono_profiler_shutdown ();
-
 #ifndef MONO_CROSS_COMPILE
        mono_runtime_cleanup (domain);
 #endif
 
+       mono_profiler_shutdown ();
+
        free_jit_tls_data ((MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id));
 
        mono_icall_cleanup ();