1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

Fixed issue with recycling count and resent messages

This commit is contained in:
Michael Lidgren
2015-02-06 19:23:32 +01:00
parent b3fffb52e5
commit 6a0abf25c3
3 changed files with 16 additions and 6 deletions

View File

@@ -187,10 +187,14 @@ namespace Lidgren.Network
{
if (m_outgoingMessagesPool == null)
return;
NetException.Assert(msg.m_recyclingCount == 0, "Wrong recycling count! Should be zero; found " + msg.m_recyclingCount);
#if DEBUG
NetException.Assert(m_outgoingMessagesPool.Contains(msg) == false, "Recyling already recycled message! Thread race?");
if (msg.m_recyclingCount != 0)
LogWarning("Wrong recycling count! should be zero; found " + msg.m_recyclingCount);
#endif
// setting m_recyclingCount to zero SHOULD be an unnecessary maneuver, if it's not zero something is wrong
// however, in RELEASE, we'll just have to accept this and move on with life
msg.m_recyclingCount = 0;
byte[] storage = msg.m_data;
msg.m_data = null;