public void Free()
 {
     if (Buffer.Count == 0 && Buffer.Array.Length != 0)
     {
         _memory.FreeByte(Buffer.Array);
         Buffer = new ArraySegment <byte>(_memory.Empty, 0, 0);
     }
 }
Esempio n. 2
0
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing)
         {
             if (_textArray != null)
             {
                 _memory.FreeChar(_textArray);
                 _textArray = null;
             }
             if (_dataArray != null)
             {
                 _memory.FreeByte(_dataArray);
                 _dataArray = null;
             }
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }