Exemple #1
0
        private bool disposedValue = false; // 要检测冗余调用

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                //if (disposing)
                //{
                //    // 释放托管状态(托管对象)。
                //}

                // 释放未托管的资源(未托管的对象)并在以下内容中替代终结器。
                // 将大型字段设置为 null。
                _Buffer.Dispose();

                disposedValue = true;
            }
        }
Exemple #2
0
 public void Dispose()
 {
     _Buffer.Dispose();
     _Count = 0;
 }