public void Dispose() { if (PEImage != null) { PEImage.Dispose(); } if (ModuleDef != null) { ModuleDef.Dispose(); } }
/// <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; }
/// <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; } }
public void Dispose() { if (ownPeImage) { if (metadata != null) { metadata.Dispose(); } if (peImage != null) { peImage.Dispose(); } } metadata = null; peImage = null; Reader = default; }
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; }
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; }
/// <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; } }
public override void Dispose() { peImage.Dispose(); }
public void Dispose() { peImage.Dispose(); }