diff options
author | Tijoy Tom Kalathiparambil <tijoytk@microsoft.com> | 2017-07-07 20:31:10 +0300 |
---|---|---|
committer | Tijoy Tom Kalathiparambil <tijoytk@microsoft.com> | 2017-07-07 20:31:10 +0300 |
commit | f64b2ae6f3d961dfd17762ba9b17f9fe4b654424 (patch) | |
tree | 7aedce3ed1d7774cd4f0324f4086b8b2f60e6c2e /src/System.Private.Interop | |
parent | 00af796d65f391a8bea927d0c4de5a204a6eeab4 (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.cs | 2 |
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 |