Skip to content

Commit

Permalink
Revert "Avoid clearing thread local handles for already unloaded loader"
Browse files Browse the repository at this point in the history
This reverts commit 94c891a.
  • Loading branch information
alexey-zakharov committed Apr 11, 2024
1 parent edb575d commit a7a68b3
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/coreclr/vm/threadstatics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,14 @@ void ThreadLocalBlock::FreeTLM(SIZE_T i, BOOL isThreadShuttingdown)
{
ThreadLocalModule::CollectibleDynamicEntry *entry = (ThreadLocalModule::CollectibleDynamicEntry*)pThreadLocalModule->m_pDynamicClassTable[k].m_pDynamicEntry;
PTR_LoaderAllocator pLoaderAllocator = entry->m_pLoaderAllocator;
// Skip assemblies that are already unloaded
if (!pLoaderAllocator->IsUnloaded())

if (entry->m_hGCStatics != NULL)
{
pLoaderAllocator->FreeHandle(entry->m_hGCStatics);
}
if (entry->m_hNonGCStatics != NULL)
{
if (entry->m_hGCStatics != NULL)
{
pLoaderAllocator->FreeHandle(entry->m_hGCStatics);
}
if (entry->m_hNonGCStatics != NULL)
{
pLoaderAllocator->FreeHandle(entry->m_hNonGCStatics);
}
pLoaderAllocator->FreeHandle(entry->m_hNonGCStatics);
}
}
delete pThreadLocalModule->m_pDynamicClassTable[k].m_pDynamicEntry;
Expand Down

0 comments on commit a7a68b3

Please sign in to comment.