/// <summary> /// 释放内存资源 /// </summary> public virtual void Dispose() { IObjectPool pool = this.GetObjectPool(); if (pool != null) { pool.Dispose(); } }
public void Dispose() { if (!_disposed) { _connectionPool.Dispose(); _disposed = true; } }
/// <summary> /// WEB请求会话已结束 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void WebRequestObjectPool_EndRequest(object sender, EventArgs e) { IObjectPool pool = this.GetObjectPool(); if (pool != null) { pool.Dispose(); HttpContext.Items.Remove(KEYNAME); } }
public void RemoveAllPools() { var enumerator = pools.GetEnumerator(); while (enumerator.MoveNext()) { IObjectPool pool = enumerator.Current.Value; pool.Dispose(); } pools.Clear(); }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _objectPool.Dispose(); } _disposedValue = true; } }
public void Dispose() { objectPool.Dispose(); }
public void Dispose() => _bytePool.Dispose();
public void Dispose() { GC.SuppressFinalize(this); _pool.Dispose(); }