From 81c4ed46bd3c1445bb1b46b260bece07d4ee4fad Mon Sep 17 00:00:00 2001 From: Matt Warren Date: Wed, 30 Aug 2017 10:18:26 +0100 Subject: [PATCH] Fix Delegate Equals() method Fixes the bug described [here](https://github.com/SteveSanderson/Blazor/blob/master/src/Blazor.Runtime/Interop/ManagedGCHandle.cs#L12-L13) --- src/DNA/corlib/System/Delegate.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DNA/corlib/System/Delegate.cs b/src/DNA/corlib/System/Delegate.cs index bd1f5494..ea3b7741 100644 --- a/src/DNA/corlib/System/Delegate.cs +++ b/src/DNA/corlib/System/Delegate.cs @@ -14,7 +14,8 @@ public override bool Equals(object obj) { if (d == null) { return false; } - return d.targetObj == this.targetObj && d.targetMethod.Equals(this.targetMethod); + // DNA currently can't handle boxing an IntPtr, so use the '==' overload instead (which doesn't have boxing) + return d.targetObj == this.targetObj && d.targetMethod == this.targetMethod; } public override int GetHashCode() { @@ -59,4 +60,4 @@ protected virtual Delegate RemoveImpl(Delegate d) { } } -#endif \ No newline at end of file +#endif