Fix use of freed memory.
Move the free later, on the assumption that the free itself doesn't use memory now freed before it.
Found with Valgrind.
Commit migrated from https://github.com/mono/mono/commit/
43f1a268045a1a3746bfd4a610b7b4874599aa38
if (profile_options)
g_ptr_array_free (profile_options, TRUE);
- free_jit_tls_data (mono_tls_get_jit_tls ());
-
mono_icall_cleanup ();
mono_runtime_cleanup_handlers ();
#ifndef MONO_CROSS_COMPILE
mono_domain_free (domain, TRUE);
#endif
+ free_jit_tls_data (mono_tls_get_jit_tls ());
#ifdef ENABLE_LLVM
if (mono_use_llvm)