Skip to content

Commit a7a68b3

Browse files
Revert "Avoid clearing thread local handles for already unloaded loader"
This reverts commit 94c891a.
1 parent edb575d commit a7a68b3

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/coreclr/vm/threadstatics.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,14 @@ void ThreadLocalBlock::FreeTLM(SIZE_T i, BOOL isThreadShuttingdown)
5151
{
5252
ThreadLocalModule::CollectibleDynamicEntry *entry = (ThreadLocalModule::CollectibleDynamicEntry*)pThreadLocalModule->m_pDynamicClassTable[k].m_pDynamicEntry;
5353
PTR_LoaderAllocator pLoaderAllocator = entry->m_pLoaderAllocator;
54-
// Skip assemblies that are already unloaded
55-
if (!pLoaderAllocator->IsUnloaded())
54+
55+
if (entry->m_hGCStatics != NULL)
56+
{
57+
pLoaderAllocator->FreeHandle(entry->m_hGCStatics);
58+
}
59+
if (entry->m_hNonGCStatics != NULL)
5660
{
57-
if (entry->m_hGCStatics != NULL)
58-
{
59-
pLoaderAllocator->FreeHandle(entry->m_hGCStatics);
60-
}
61-
if (entry->m_hNonGCStatics != NULL)
62-
{
63-
pLoaderAllocator->FreeHandle(entry->m_hNonGCStatics);
64-
}
61+
pLoaderAllocator->FreeHandle(entry->m_hNonGCStatics);
6562
}
6663
}
6764
delete pThreadLocalModule->m_pDynamicClassTable[k].m_pDynamicEntry;

0 commit comments

Comments
 (0)