Skip to content

Commit b85bdfa

Browse files
authored
Make BamlMapTable's KnownAssemblyInfoRecord an instance field (#589)
1 parent 7fa3965 commit b85bdfa

File tree

1 file changed

+8
-6
lines changed
  • src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup

1 file changed

+8
-6
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/BamlMapTable.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ internal BamlMapTable(XamlTypeMapper xamlTypeMapper)
7979
_xamlTypeMapper = xamlTypeMapper;
8080

8181
// Setup the assembly record for the known types of controls
82-
KnownAssemblyInfoRecord = new BamlAssemblyInfoRecord();
83-
KnownAssemblyInfoRecord.AssemblyId = -1;
84-
KnownAssemblyInfoRecord.Assembly = ReflectionHelper.LoadAssembly(_frameworkAssembly, string.Empty);
85-
KnownAssemblyInfoRecord.AssemblyFullName = KnownAssemblyInfoRecord.Assembly.FullName;
82+
_knownAssemblyInfoRecord = new BamlAssemblyInfoRecord();
83+
_knownAssemblyInfoRecord.AssemblyId = -1;
84+
_knownAssemblyInfoRecord.Assembly = ReflectionHelper.LoadAssembly(_frameworkAssembly, string.Empty);
85+
_knownAssemblyInfoRecord.AssemblyFullName = _knownAssemblyInfoRecord.Assembly.FullName;
8686
}
8787

8888
#endregion Constructor
@@ -995,7 +995,7 @@ internal BamlAssemblyInfoRecord GetAssemblyInfoFromId(short id)
995995
// case return the known assembly info record.
996996
if (id == -1)
997997
{
998-
return KnownAssemblyInfoRecord;
998+
return _knownAssemblyInfoRecord;
999999
}
10001000
else
10011001
{
@@ -1803,7 +1803,6 @@ private Hashtable ConverterCache
18031803

18041804
private const string _coreAssembly = "PresentationCore";
18051805
private const string _frameworkAssembly = "PresentationFramework";
1806-
private static BamlAssemblyInfoRecord KnownAssemblyInfoRecord;
18071806

18081807
private static string[] _knownStrings =
18091808
{
@@ -1830,6 +1829,9 @@ private Hashtable ConverterCache
18301829
// XamlTypeMapper associated with this map table. There is always a one-to-one correspondence.
18311830
XamlTypeMapper _xamlTypeMapper;
18321831

1832+
// The assembly record for the known types of controls
1833+
BamlAssemblyInfoRecord _knownAssemblyInfoRecord;
1834+
18331835
#if !PBTCOMPILER
18341836
// Temporary cache of Known Type Converters for each baml reading session.
18351837
Hashtable _converterCache = null;

0 commit comments

Comments
 (0)