Keep delegate fields alive across a full native call (#20896)
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>
Sun, 11 Nov 2018 00:07:33 +0000 (16:07 -0800)
committerGitHub <noreply@github.com>
Sun, 11 Nov 2018 00:07:33 +0000 (16:07 -0800)
commit463ba889b0c010eb9c6f9807eaf0ab4ab5624450
treedbddeb8d3539468ce4af86c9a408f91c41764e67
parent845fc293bef24024f779e05ebc33971bea2728d3
Keep delegate fields alive across a full native call (#20896)

* Repurpose CleanupWorkList to also preserve delegate references in structs across the full native call.

* Change CleanupWorkListElement to abstract base class instead of interface.

* Make CleanupWorkList a singlely linked list.

* PR Feedback.

* Remove CleanupWorkList and make CleanupWorkListElement be able to represent the full list.

* Add back throw in SafeHandle field marshalling.

* PR feedback.
src/System.Private.CoreLib/src/System/StubHelpers.cs
src/vm/dllimport.cpp
src/vm/fieldmarshaler.cpp
src/vm/ilmarshalers.cpp
src/vm/metasig.h
src/vm/mscorlib.h
tests/src/Interop/PInvoke/Delegate/MarshalDelegateAsField/AsDefault/AsDefaultTest.cs