summaryrefslogtreecommitdiff
path: root/src/vm/corhost.cpp
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-10-17 16:20:36 -0700
committerJan Kotas <jkotas@microsoft.com>2018-10-17 16:20:36 -0700
commit2ac658f8df5ba07b68e1d06482089ca49ac83fc3 (patch)
treeae684ccd231d2a899489d4cddf3bcd3fdd173272 /src/vm/corhost.cpp
parent143d5a2ebb0c49e33ed60b9fb69cedd0aeffe3d1 (diff)
downloadcoreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.tar.gz
coreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.tar.bz2
coreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.zip
Fix collectible NativeCallable UMThunkEntry lifetime (#20438)
* Fix collectible NativeCallable UMThunkEntry lifetime The UMEntryThunk cache entries created for NativeCallable target methods for collectible classes were not properly cleaned up at the unload time. This change fixes that by adding UMEntryThunkCache on LoaderAllocator and using it for entries belonging to NativeCallable targets on collectible classes. The cache is created lazily. * Reflect PR feedback Remove the UMEntryThunk cache from the AppDomain and leave it just on the LoaderAllocator.
Diffstat (limited to 'src/vm/corhost.cpp')
-rw-r--r--src/vm/corhost.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp
index f9785ab19f..03fbdb9df8 100644
--- a/src/vm/corhost.cpp
+++ b/src/vm/corhost.cpp
@@ -798,7 +798,7 @@ HRESULT CorHost2::_CreateDelegate(
if (pMD==NULL || !pMD->IsStatic() || pMD->ContainsGenericVariables())
ThrowHR(COR_E_MISSINGMETHOD);
- UMEntryThunk *pUMEntryThunk = GetAppDomain()->GetUMEntryThunkCache()->GetUMEntryThunk(pMD);
+ UMEntryThunk *pUMEntryThunk = pMD->GetLoaderAllocator()->GetUMEntryThunkCache()->GetUMEntryThunk(pMD);
*fnPtr = (INT_PTR)pUMEntryThunk->GetCode();
END_DOMAIN_TRANSITION;