Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTijoy Tom Kalathiparambil <tijoytk@microsoft.com>2017-07-07 20:31:10 +0300
committerTijoy Tom Kalathiparambil <tijoytk@microsoft.com>2017-07-07 20:31:10 +0300
commitf64b2ae6f3d961dfd17762ba9b17f9fe4b654424 (patch)
tree7aedce3ed1d7774cd4f0324f4086b8b2f60e6c2e /src/System.Private.Interop
parent00af796d65f391a8bea927d0c4de5a204a6eeab4 (diff)
WindowsRuntimeMarshal.RemoveEventHandler was doing the wrong thing for static remove method. For static method delegate.Target is null and it takes the
ManagedEventRegistrationImpl code path which asserts target!=null .CoreCLR does the right thing https://github.com/Microsoft/referencesource/blob/master/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs#L98 [tfs-changeset: 1665004]
Diffstat (limited to 'src/System.Private.Interop')
-rw-r--r--src/System.Private.Interop/src/Shared/WindowsRuntimeMarshal.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/System.Private.Interop/src/Shared/WindowsRuntimeMarshal.cs b/src/System.Private.Interop/src/Shared/WindowsRuntimeMarshal.cs
index 294a2e2a6..f7a413505 100644
--- a/src/System.Private.Interop/src/Shared/WindowsRuntimeMarshal.cs
+++ b/src/System.Private.Interop/src/Shared/WindowsRuntimeMarshal.cs
@@ -98,7 +98,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
// it would be more confusing and less-performant if we were to merge them together
#if !RHTESTCL
object target = removeMethod.Target;
- if (target != null && target is __ComObject)
+ if (target == null || target is __ComObject)
NativeOrStaticEventRegistrationImpl.RemoveAllEventHandlers(removeMethod);
else
#endif