예제 #1
0
        /// <summary>
        /// Release the buffers currently cached in this manager.
        /// </summary>
        /// <param name="disposing">true if managed resources are to be disposed</param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            m_bufferManager.Clear();
        }
예제 #2
0
        /// <summary>
        /// 清空堆栈
        /// </summary>
        public void Clear()
        {
            if (pool != null)
            {
                pool.Clear();
            }

            if (bufferManager != null)
            {
                bufferManager.Clear();
            }
        }
예제 #3
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            Clear();
            pool = null;

            if (this.bufferManager != null)
            {
                bufferManager.Clear();
                bufferManager = null;
            }

            GC.SuppressFinalize(this);
        }
예제 #4
0
 /// <summary>
 /// 清空堆栈
 /// </summary>
 public void Clear()
 {
     pool?.Clear();
     bufferManager?.Clear();
 }
예제 #5
0
 public void Dispose()
 {
     bufferManager.Clear();
     // note that disposing the pool before returning all of the buffers will cause a crash
 }
예제 #6
0
 /// <summary>
 /// Releases all the buffers currently cached in the pool.
 /// </summary>
 public static void Clear()
 {
     s_bufferManager.Clear();
 }
 public void Dispose()
 {
     pool.Clear();
 }