Skip to content

Commit

Permalink
Moved ReleaseHandle() to DirectByteBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mullerj committed Jul 22, 2024
1 parent d8a471d commit 2a41c44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/dotnet/src/Mil.Navy.Nrl.Norm/Buffers/ByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@ protected ByteBuffer() : base(true)
public static ByteBuffer AllocateDirect(int capacity) {
return new DirectByteBuffer(capacity);
}

protected override bool ReleaseHandle()
{
Marshal.FreeHGlobal(handle);
return true;
}
}
}
6 changes: 6 additions & 0 deletions src/dotnet/src/Mil.Navy.Nrl.Norm/Buffers/DirectByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ internal DirectByteBuffer(int capacity)
SetHandle(Marshal.AllocHGlobal(capacity));
Initialize(Convert.ToUInt64(capacity));
}

protected override bool ReleaseHandle()
{
Marshal.FreeHGlobal(handle);
return true;
}
}
}

0 comments on commit 2a41c44

Please sign in to comment.