From 9236c0bcd880984e7ce0d2060cca6d704c00b5a5 Mon Sep 17 00:00:00 2001 From: David Mason Date: Sat, 11 Jun 2022 02:09:48 -0700 Subject: [PATCH] Move freeing the dynamic heaps until after freeing the code data --- src/coreclr/vm/dynamicmethod.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/coreclr/vm/dynamicmethod.cpp b/src/coreclr/vm/dynamicmethod.cpp index badc16f75df418..ff9cf443edd850 100644 --- a/src/coreclr/vm/dynamicmethod.cpp +++ b/src/coreclr/vm/dynamicmethod.cpp @@ -1010,13 +1010,6 @@ void LCGMethodResolver::Destroy() } } - // Note that we need to do this before m_jitTempData is deleted - RecycleIndCells(); - - m_jitMetaHeap.Delete(); - m_jitTempData.Delete(); - - if (m_recordCodePointer) { #if defined(TARGET_AMD64) @@ -1050,6 +1043,12 @@ void LCGMethodResolver::Destroy() m_pJumpStubCache = NULL; } + // Note that we need to do this before m_jitTempData is deleted + RecycleIndCells(); + + m_jitMetaHeap.Delete(); + m_jitTempData.Delete(); + if (m_managedResolver) { ::DestroyLongWeakHandle(m_managedResolver);