Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the rented pixel array back to the pool.
        /// </summary>
        private void ReturnPixels()
        {
            PixelDataPool <TPixel> .Return(this.PixelBuffer);

            this.PixelBuffer = null;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the rented pixel array back to the pool.
        /// </summary>
        private void ReturnPixels()
        {
            PixelDataPool <TColor> .Return(this.pixelBuffer);

            this.pixelBuffer = null;
        }