Skip to content

Commit

Permalink
Fix packet disposing
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrighthere authored Sep 30, 2018
1 parent b492656 commit 73c9d12
Show file tree
Hide file tree
Showing 2 changed files with 5,449 additions and 5,442 deletions.
8 changes: 4 additions & 4 deletions Source/Managed/ENet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public Packet(IntPtr packet) {

public void Dispose() {
if (nativePacket != IntPtr.Zero) {
Native.enet_packet_destroy(nativePacket);
Native.enet_packet_dispose(nativePacket);
nativePacket = IntPtr.Zero;
}
}
Expand Down Expand Up @@ -686,7 +686,7 @@ public static class Library {
public const uint timeoutLimit = 32;
public const uint timeoutMinimum = 5000;
public const uint timeoutMaximum = 30000;
public const uint version = (2 << 16) | (0 << 8) | (8);
public const uint version = (2 << 16) | (0 << 8) | (9);

public static int Initialize() {
return Native.enet_initialize();
Expand Down Expand Up @@ -745,7 +745,7 @@ internal static class Native {
internal static extern void enet_packet_set_free_callback(IntPtr packet, IntPtr callback);

[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
internal static extern void enet_packet_destroy(IntPtr packet);
internal static extern void enet_packet_dispose(IntPtr packet);

[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr enet_host_create(ref ENetAddress address, IntPtr peerLimit, IntPtr channelLimit, uint incomingBandwidth, uint outgoingBandwidth);
Expand Down Expand Up @@ -852,4 +852,4 @@ internal static class Native {
[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
internal static extern void enet_peer_reset(IntPtr peer);
}
}
}
Loading

0 comments on commit 73c9d12

Please sign in to comment.