diff options
author | Aaron Robinson <arobins@microsoft.com> | 2020-08-11 19:52:55 -0400 |
---|---|---|
committer | 조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com> | 2021-01-15 10:30:24 +0900 |
commit | 01ce73cb2ebaa8d0e9d4025371849459a8e0ffd2 (patch) | |
tree | 42dd930435eb4fd51f80abeaec3c057cf4521a89 | |
parent | b2ca580fb52ac30dadec4d6c859bae66af8784c0 (diff) | |
download | coreclr-01ce73cb2ebaa8d0e9d4025371849459a8e0ffd2.tar.gz coreclr-01ce73cb2ebaa8d0e9d4025371849459a8e0ffd2.tar.bz2 coreclr-01ce73cb2ebaa8d0e9d4025371849459a8e0ffd2.zip |
Fix memory leaked caused by Marshal.GetFunctionPointerForDelegate (#28074)submit/tizen_6.0/20210115.013248submit/tizen/20210115.013305accepted/tizen/unified/20210115.125752accepted/tizen/6.0/unified/20210115.041837tizen_6.0accepted/tizen_6.0_unified
-rw-r--r-- | src/vm/dllimportcallback.cpp | 7 | ||||
-rw-r--r-- | src/vm/dllimportcallback.h | 16 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/vm/dllimportcallback.cpp b/src/vm/dllimportcallback.cpp index b5a4c9c4d7..8c4970970b 100644 --- a/src/vm/dllimportcallback.cpp +++ b/src/vm/dllimportcallback.cpp @@ -961,11 +961,18 @@ void UMEntryThunk::Terminate() CONTRACTL { NOTHROW; + MODE_ANY; } CONTRACTL_END; m_code.Poison(); + if (GetObjectHandle()) + { + DestroyLongWeakHandle(GetObjectHandle()); + m_pObjectHandle = 0; + } + s_thunkFreeList.AddToList(this); } diff --git a/src/vm/dllimportcallback.h b/src/vm/dllimportcallback.h index 3d93d3263b..03be244e54 100644 --- a/src/vm/dllimportcallback.h +++ b/src/vm/dllimportcallback.h @@ -310,22 +310,6 @@ public: #endif } - ~UMEntryThunk() - { - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END; - - if (GetObjectHandle()) - { - DestroyLongWeakHandle(GetObjectHandle()); - } - } - void Terminate(); VOID RunTimeInit() |