PoolScope
A disposable scope that automatically returns a pooled object when disposed.
internal readonly struct PoolScope<T> : System.IDisposable where T : classConstructors
Section titled “Constructors”PoolScope(T, ObjectPool<T>)
Section titled “PoolScope(T, ObjectPool<T>)”Creates a new pool scope that will return the specified item to the pool when disposed.
public PoolScope(T item, ObjectPool<T> pool);The pooled object to return on disposal.
The pool to return the object to.
Methods
Section titled “Methods”Dispose()
Section titled “Dispose()”Returns the pooled object back to the pool.
public void Dispose();