projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ea817f
)
Check if a UMEntryThunk has an existing handle
author
mateoatr
<matorre@microsoft.com>
Fri, 6 Dec 2019 23:42:52 +0000
(23:42 +0000)
committer
mateoatr
<matorre@microsoft.com>
Fri, 6 Dec 2019 23:42:52 +0000
(23:42 +0000)
before creating a new one.
src/coreclr/src/vm/comdelegate.cpp
patch
|
blob
|
history
diff --git
a/src/coreclr/src/vm/comdelegate.cpp
b/src/coreclr/src/vm/comdelegate.cpp
index c703333d0d93e0d57fcf02c5322761e089a9c377..a1e403b582412c4306bbe4072fdebd900a8c9cf9 100644
(file)
--- a/
src/coreclr/src/vm/comdelegate.cpp
+++ b/
src/coreclr/src/vm/comdelegate.cpp
@@
-1307,7
+1307,9
@@
LPVOID COMDelegate::ConvertToCallback(OBJECTREF pDelegateObj)
umHolder.Assign(pUMEntryThunk);
// multicast. go thru Invoke
- OBJECTHANDLE objhnd = GetAppDomain()->CreateLongWeakHandle(pDelegate);
+ OBJECTHANDLE objhnd = pUMEntryThunk->GetObjectHandle();
+ if (objhnd == NULL)
+ objhnd = GetAppDomain()->CreateLongWeakHandle(pDelegate);
_ASSERTE(objhnd != NULL);
// This target should not ever be used. We are storing it in the thunk for better diagnostics of "call on collected delegate" crashes.