System.IO.UnmanagedMemoryStream.Dispose C# (CSharp) Méthode

Dispose() private méthode

private Dispose ( bool disposing ) : void
disposing bool
Résultat void
        protected override void Dispose(bool disposing)
        {
            _isOpen = false;
            unsafe { _mem = null; }

            // Stream allocates WaitHandles for async calls. So for correctness
            // call base.Dispose(disposing) for better perf, avoiding waiting
            // for the finalizers to run on those types.
            base.Dispose(disposing);
        }

Usage Example

        /// <summary>
        /// A portion of the file contents have been received. This method will
        /// be called multiple times until the download is complete. Return
        /// |true| to continue receiving data and |false| to cancel.
        /// </summary>
        private int received_data(cef_download_handler_t* self, void* data, int data_size)
        {
            ThrowIfObjectDisposed();

            var m_stream = new UnmanagedMemoryStream((byte*)data, data_size, data_size, FileAccess.Read);

            var handled = this.ReceivedData(m_stream);

            m_stream.Dispose();

            return handled ? 1 : 0;
        }
All Usage Examples Of System.IO.UnmanagedMemoryStream::Dispose