예제 #1
0
 public void Dispose()
 {
     if (PEImage != null)
     {
         PEImage.Dispose();
     }
     if (ModuleDef != null)
     {
         ModuleDef.Dispose();
     }
 }
예제 #2
0
 /// <summary>
 /// Dispose method
 /// </summary>
 /// <param name="disposing"><c>true</c> if called by <see cref="Dispose()"/></param>
 protected virtual void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (peImage != null)
     {
         peImage.Dispose();
     }
     if (stringsStream != null)
     {
         stringsStream.Dispose();
     }
     if (usStream != null)
     {
         usStream.Dispose();
     }
     if (blobStream != null)
     {
         blobStream.Dispose();
     }
     if (guidStream != null)
     {
         guidStream.Dispose();
     }
     if (tablesStream != null)
     {
         tablesStream.Dispose();
     }
     if (allStreams != null)
     {
         foreach (var stream in allStreams)
         {
             if (stream != null)
             {
                 stream.Dispose();
             }
         }
     }
     peImage                   = null;
     cor20Header               = null;
     mdHeader                  = null;
     stringsStream             = null;
     usStream                  = null;
     blobStream                = null;
     guidStream                = null;
     tablesStream              = null;
     allStreams                = null;
     fieldRidToTypeDefRid      = null;
     methodRidToTypeDefRid     = null;
     typeDefRidToNestedClasses = null;
 }
예제 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="peImage">The PE image</param>
 /// <param name="cor20Header">The .NET header</param>
 /// <param name="mdHeader">The MD header</param>
 protected MetaData(IPEImage peImage, ImageCor20Header cor20Header, MetaDataHeader mdHeader)
 {
     try {
         this.allStreams  = ThreadSafeListCreator.Create <DotNetStream>();
         this.peImage     = peImage;
         this.cor20Header = cor20Header;
         this.mdHeader    = mdHeader;
     }
     catch {
         if (peImage != null)
         {
             peImage.Dispose();
         }
         throw;
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="peImage">The PE image</param>
 /// <param name="cor20Header">The .NET header</param>
 /// <param name="mdHeader">The MD header</param>
 protected MetadataBase(IPEImage peImage, ImageCor20Header cor20Header, MetadataHeader mdHeader)
 {
     try {
         allStreams              = new List <DotNetStream>();
         this.peImage            = peImage;
         this.cor20Header        = cor20Header;
         this.mdHeader           = mdHeader;
         isStandalonePortablePdb = false;
     }
     catch {
         if (peImage != null)
         {
             peImage.Dispose();
         }
         throw;
     }
 }
예제 #5
0
        public void Dispose()
        {
            if (ownPeImage)
            {
                if (metadata != null)
                {
                    metadata.Dispose();
                }
                if (peImage != null)
                {
                    peImage.Dispose();
                }
            }

            metadata = null;
            peImage  = null;
            Reader   = default;
        }
예제 #6
0
        public void Dispose()
        {
            if (ownPeImage)
            {
                if (dnFile != null)
                {
                    dnFile.Dispose();
                }
                if (peImage != null)
                {
                    peImage.Dispose();
                }
            }
            if (peStream != null)
            {
                peStream.Dispose();
            }

            dnFile   = null;
            peImage  = null;
            peStream = null;
        }
예제 #7
0
        public void Dispose()
        {
            if (ownPeImage)
            {
                if (metaData != null)
                {
                    metaData.Dispose();
                }
                if (peImage != null)
                {
                    peImage.Dispose();
                }
            }
            if (peStream != null)
            {
                peStream.Dispose();
            }

            metaData = null;
            peImage  = null;
            peStream = null;
        }
        /// <summary>
        /// Dispose method
        /// </summary>
        /// <param name="disposing"><c>true</c> if called by <see cref="Dispose()"/></param>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }
            peImage?.Dispose();
            stringsStream?.Dispose();
            usStream?.Dispose();
            blobStream?.Dispose();
            guidStream?.Dispose();
            tablesStream?.Dispose();
            var as2 = allStreams;

            if (as2 != null)
            {
                foreach (var stream in as2)
                {
                    stream?.Dispose();
                }
            }
            mdReaderFactoryToDisposeLater?.Dispose();
            peImage                       = null;
            cor20Header                   = null;
            mdHeader                      = null;
            stringsStream                 = null;
            usStream                      = null;
            blobStream                    = null;
            guidStream                    = null;
            tablesStream                  = null;
            allStreams                    = null;
            fieldRidToTypeDefRid          = null;
            methodRidToTypeDefRid         = null;
            typeDefRidToNestedClasses     = null;
            mdReaderFactoryToDisposeLater = null;
        }
예제 #9
0
파일: MetaData.cs 프로젝트: NSentinel/dnlib
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="peImage">The PE image</param>
 /// <param name="cor20Header">The .NET header</param>
 /// <param name="mdHeader">The MD header</param>
 protected MetaData(IPEImage peImage, ImageCor20Header cor20Header, MetaDataHeader mdHeader)
 {
     try {
         this.allStreams = ThreadSafeListCreator.Create<DotNetStream>();
         this.peImage = peImage;
         this.cor20Header = cor20Header;
         this.mdHeader = mdHeader;
     }
     catch {
         if (peImage != null)
             peImage.Dispose();
         throw;
     }
 }
예제 #10
0
파일: DnSpyFile.cs 프로젝트: mrexodia/dnSpy
 public override void Dispose()
 {
     peImage.Dispose();
 }
예제 #11
0
 public void Dispose()
 {
     peImage.Dispose();
 }