NetMsg uses the flat function to release

This commit is contained in:
Garry Newman 2020-02-24 10:14:59 +00:00
parent afd314627d
commit 3c8a2f6cd1
3 changed files with 6 additions and 14 deletions

View File

@ -108,7 +108,7 @@ namespace Steamworks
//
// Releases the message
//
msg.Release( msgPtr );
NetMsg.InternalRelease( (NetMsg*) msgPtr );
}
}

View File

@ -17,17 +17,5 @@ namespace Steamworks.Data
internal IntPtr FreeDataPtr;
internal IntPtr ReleasePtr;
internal int Channel;
internal delegate void ReleaseDelegate( IntPtr msg );
public void Release( IntPtr data )
{
//
// I think this function might be a static global, so we could probably
// cache this release call.
//
var d = Marshal.GetDelegateForFunctionPointer<ReleaseDelegate>( ReleasePtr );
d( data );
}
}
}

View File

@ -32,6 +32,10 @@ namespace Steamworks
if ( SteamNetworkingSockets.Internal.IsValid )
{
SteamNetworkingSockets.Internal.DestroyPollGroup( pollGroup );
Console.WriteLine( "Closing Socket!" );
Console.WriteLine( Socket.ToString() );
Socket.Close();
}
@ -128,7 +132,7 @@ namespace Steamworks
//
// Releases the message
//
msg.Release( msgPtr );
NetMsg.InternalRelease( (NetMsg*) msgPtr );
}
}