Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code review fixes
  • Loading branch information
BadSingleton committed Mar 5, 2021
commit 891ad8c93afba36499b777b5140a388cb70e9d6a
7 changes: 5 additions & 2 deletions src/runtime/exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ internal static Exception ToException(IntPtr ob)
static void ClearOffsetHelper(IntPtr ob, int offset)
{
var field = Marshal.ReadIntPtr(ob, offset);
Runtime.XDecref(field);
Marshal.WriteIntPtr(ob, offset, IntPtr.Zero);
if (field != IntPtr.Zero)
{
Marshal.WriteIntPtr(ob, offset, IntPtr.Zero);
Runtime.XDecref(field);
}
}
Comment thread
lostmsu marked this conversation as resolved.

// As seen in exceptions.c, every derived type must also clean the base.
Expand Down