/// <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(); }
/// <summary> /// 清空堆栈 /// </summary> public void Clear() { if (pool != null) { pool.Clear(); } if (bufferManager != null) { bufferManager.Clear(); } }
/// <summary> /// 释放资源 /// </summary> public void Dispose() { Clear(); pool = null; if (this.bufferManager != null) { bufferManager.Clear(); bufferManager = null; } GC.SuppressFinalize(this); }
/// <summary> /// 清空堆栈 /// </summary> public void Clear() { pool?.Clear(); bufferManager?.Clear(); }
public void Dispose() { bufferManager.Clear(); // note that disposing the pool before returning all of the buffers will cause a crash }
/// <summary> /// Releases all the buffers currently cached in the pool. /// </summary> public static void Clear() { s_bufferManager.Clear(); }
public void Dispose() { pool.Clear(); }