Pchp.Library.Streams.PhpStream.FreeManaged C# (CSharp) Method

FreeManaged() protected method

PhpResource.FreeManaged overridden to get rid of the contained context on Dispose.
protected FreeManaged ( ) : void
return void
        protected override void FreeManaged()
        {
            // Flush the underlying stream before closing.
            if ((writeFilters != null) && (writeFilters.Count > 0))
            {
                // Pass an empty data with closing == true through all the filters.
                WriteData(TextElement.Empty, true);
            }

            Flush();

            if (_context != null)
            {
                _context.Dispose();
                _context = null;
            }

            //writeBuffer = null;

            base.FreeManaged();
        }