Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface ISignatureEmitter
void MaterializeSignature();
}

public class ManifestMetadataTableNode : HeaderTableNode
public class ManifestMetadataTableNode : HeaderTableNode, IDisposable
{
/// <summary>
/// Map from simple assembly names to their module indices. The map gets prepopulated
Expand Down Expand Up @@ -329,5 +329,10 @@ internal byte[] GetManifestAssemblyMvidTableData()
}
return manifestAssemblyMvidTable;
}

public void Dispose()
{
_modulesWhichMustBeIndexable = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,11 @@ public ISymbolNode GetFieldRvaData(FieldDesc field)

public override void Dispose()
{
Array.Clear(_corInfoImpls);
// Workaround for https://github.com/dotnet/runtime/issues/23103.
// ManifestMetadataTable.Dispose() allows to break circular reference
// ConcurrentBag<EcmaModule> -> EcmaModule -> EcmaAssembly -> ReadyToRunCompilerContext -> ... -> ConcurrentBag<EcmaModule>.
// This circular reference along with #23103 prevents objects from being collected by GC.
_nodeFactory.ManifestMetadataTable.Dispose();
}

public string GetReproInstructions(MethodDesc method)
Expand Down
Loading