diff --git a/Lidgren.Network/NetPeer.Recycling.cs b/Lidgren.Network/NetPeer.Recycling.cs index bd2a7db..5198812 100644 --- a/Lidgren.Network/NetPeer.Recycling.cs +++ b/Lidgren.Network/NetPeer.Recycling.cs @@ -190,7 +190,7 @@ namespace Lidgren.Network reduceTo = m_maxStoredBytes / 2; int remove = 0; - while (m_storedBytes > reduceTo && m_storagePool.Count > 0) + while (m_storedBytes > reduceTo && remove < m_storagePool.Count) { byte[] arr = m_storagePool[0]; m_storedBytes -= arr.Length;