示例#1
0
        /// <summary>
        /// 释放内存资源
        /// </summary>
        public virtual void Dispose()
        {
            IObjectPool pool = this.GetObjectPool();

            if (pool != null)
            {
                pool.Dispose();
            }
        }
示例#2
0
        public void Dispose()
        {
            if (!_disposed)
            {
                _connectionPool.Dispose();

                _disposed = true;
            }
        }
示例#3
0
        /// <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);
            }
        }
示例#4
0
    public void RemoveAllPools()
    {
        var enumerator = pools.GetEnumerator();

        while (enumerator.MoveNext())
        {
            IObjectPool pool = enumerator.Current.Value;
            pool.Dispose();
        }
        pools.Clear();
    }
示例#5
0
 /// <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;
     }
 }
示例#6
0
 public void Dispose()
 {
     objectPool.Dispose();
 }
 public void Dispose() => _bytePool.Dispose();
示例#8
0
 public void Dispose()
 {
     GC.SuppressFinalize(this);
     _pool.Dispose();
 }