Exemplo n.º 1
0
        protected internal override void Dispose(bool disposing)
        {
            if (false.Equals(disposing) || false.Equals(ShouldDispose))
            {
                return;
            }

            base.Dispose(ShouldDispose);

            if (false.Equals(IsDisposed))
            {
                return;
            }

            if (false.Equals(IDisposedExtensions.IsNullOrDisposed(First16Bits)))
            {
                //Dispose the instance
                First16Bits.Dispose();

                //Remove the reference to the CommonHeaderBits instance
                First16Bits = null;
            }

            if (false.Equals(IDisposedExtensions.IsNullOrDisposed(SegmentToLast6Bytes)))
            {
                //Invalidate the pointer
                SegmentToLast6Bytes.Dispose();

                SegmentToLast6Bytes = null;
            }

            //Remove the reference to the allocated array.
            Last6Bytes = null;
        }
Exemplo n.º 2
0
        public override void Dispose()
        {
            if (IsDisposed || false == ShouldDispose)
            {
                return;
            }

            base.Dispose();

            m_ByteCache.Dispose();

            if (m_LeaveOpen)
            {
                return;
            }

            m_BaseStream.Dispose();
        }
Exemplo n.º 3
0
        public override void Dispose()
        {
            //Write remaining bits
            Flush();

            if (IsDisposed)
            {
                return;
            }

            base.Dispose();

            m_ByteCache.Dispose();

            if (m_LeaveOpen)
            {
                return;
            }

            m_BaseStream.Dispose();
        }