Skip to content

Commit

Permalink
Remove use of NewHolder as field. (#97837)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronRobinsonMSFT authored Feb 2, 2024
1 parent a102e88 commit 36d41c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/coreclr/vm/syncblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ InteropSyncBlockInfo::~InteropSyncBlockInfo()
CONTRACTL_END;

FreeUMEntryThunk();

#if defined(FEATURE_COMWRAPPERS)
delete m_managedObjectComWrapperMap;
#endif // FEATURE_COMWRAPPERS
}

#ifndef TARGET_UNIX
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/syncblk.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ class InteropSyncBlockInfo
if (m_managedObjectComWrapperMap == NULL)
{
NewHolder<ManagedObjectComWrapperByIdMap> map = new ManagedObjectComWrapperByIdMap();
if (InterlockedCompareExchangeT((ManagedObjectComWrapperByIdMap**)&m_managedObjectComWrapperMap, (ManagedObjectComWrapperByIdMap *)map, NULL) == NULL)
if (InterlockedCompareExchangeT(&m_managedObjectComWrapperMap, (ManagedObjectComWrapperByIdMap *)map, NULL) == NULL)
{
map.SuppressRelease();
}
Expand Down Expand Up @@ -917,7 +917,7 @@ class InteropSyncBlockInfo
void* m_externalComObjectContext;

CrstExplicitInit m_managedObjectComWrapperLock;
NewHolder<ManagedObjectComWrapperByIdMap> m_managedObjectComWrapperMap;
ManagedObjectComWrapperByIdMap* m_managedObjectComWrapperMap;
#endif // FEATURE_COMWRAPPERS

#ifdef FEATURE_OBJCMARSHAL
Expand Down

0 comments on commit 36d41c6

Please sign in to comment.