/// <summary> /// Disposes the <see cref="PinnedBuffer{T}"/> instance by unpinning the array, and returning the pooled buffer when necessary. /// </summary> public void Dispose() { if (this.IsDisposedOrLostArrayOwnership) { return; } this.IsDisposedOrLostArrayOwnership = true; this.UnPin(); if (this.isPoolingOwner) { PixelDataPool <T> .Return(this.Array); } this.Array = null; this.Count = 0; GC.SuppressFinalize(this); }
/// <summary> /// Returns the rented pixel array back to the pool. /// </summary> private void ReturnPixels() { PixelDataPool <TPixel> .Return(this.PixelBuffer); this.PixelBuffer = null; }
/// <summary> /// Returns the rented pixel array back to the pool. /// </summary> private void ReturnPixels() { PixelDataPool <TColor> .Return(this.pixelBuffer); this.pixelBuffer = null; }