diff --git a/src/coreclr/vm/class.cpp b/src/coreclr/vm/class.cpp index fd6053c64bfb5..6558f7dec2e18 100644 --- a/src/coreclr/vm/class.cpp +++ b/src/coreclr/vm/class.cpp @@ -162,7 +162,8 @@ void EEClass::Destruct(MethodTable * pOwningMT) } if (pDelegateEEClass->m_pInstRetBuffCallStub) { - pDelegateEEClass->m_pInstRetBuffCallStub->DecRef(); + ExecutableWriterHolder stubWriterHolder(pDelegateEEClass->m_pInstRetBuffCallStub, sizeof(Stub)); + stubWriterHolder.GetRW()->DecRef(); } // While m_pMultiCastInvokeStub is also a member, // it is owned by the m_pMulticastStubCache, not by the class