コード例 #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);
        }
コード例 #2
0
        /// <summary>
        /// Returns the rented pixel array back to the pool.
        /// </summary>
        private void ReturnPixels()
        {
            PixelDataPool <TPixel> .Return(this.PixelBuffer);

            this.PixelBuffer = null;
        }
コード例 #3
0
        /// <summary>
        /// Returns the rented pixel array back to the pool.
        /// </summary>
        private void ReturnPixels()
        {
            PixelDataPool <TColor> .Return(this.pixelBuffer);

            this.pixelBuffer = null;
        }