Browse Source

Fixed "COM object that has been separated from its underlying RCW cannot be used." in MetaDataImport

pull/1/head
David Srbecký 15 years ago
parent
commit
fb51065400
  1. 16
      src/AddIns/Debugger/Debugger.Core/Interop/MetaDataWrapper.cs
  2. 2
      src/AddIns/Debugger/Debugger.Core/Module.cs

16
src/AddIns/Debugger/Debugger.Core/Interop/MetaDataWrapper.cs

@ -16,7 +16,7 @@ namespace Debugger.Interop.MetaData @@ -16,7 +16,7 @@ namespace Debugger.Interop.MetaData
{
/// <summary>Wrapper for the unmanaged metadata API.</summary>
/// <remarks>http://msdn.microsoft.com/en-us/library/ms230172.aspx</remarks>
public class MetaDataImport: IDisposable
public class MetaDataImport
{
const int DefaultBufferSize = 8;
// If buffer is too small, enlarge it
@ -53,20 +53,6 @@ namespace Debugger.Interop.MetaData @@ -53,20 +53,6 @@ namespace Debugger.Interop.MetaData
}
}
~MetaDataImport()
{
Dispose();
}
public void Dispose()
{
IMetaDataImport m = this.metaData;
if (m != null) {
Marshal.FinalReleaseComObject(m);
metaData = null;
}
}
// CloseEnum, CountEnum and ResetEnum are not wrapped, use them directly
// GetNameFromToken is obsolete

2
src/AddIns/Debugger/Debugger.Core/Module.cs

@ -307,8 +307,6 @@ namespace Debugger @@ -307,8 +307,6 @@ namespace Debugger
public void Dispose()
{
UnloadSymbols();
metaData.Dispose();
unloaded = true;
}

Loading…
Cancel
Save