Skip to content

PoolScope

A disposable scope that automatically returns a pooled object when disposed.

C# Signature
internal readonly struct PoolScope<T> : System.IDisposable where T : class

Creates a new pool scope that will return the specified item to the pool when disposed.

C# Signature
public PoolScope(T item, ObjectPool<T> pool);

The pooled object to return on disposal.

The pool to return the object to.

Returns the pooled object back to the pool.

C# Signature
public void Dispose();