summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-07-01 13:02:08 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-07-01 13:02:08 -0400
commite548a4ea9bf24c28ebc024e12af73cd14b76f05f (patch)
tree3a795e518b4c3922dd2804281154df98ee5ed54e /src
parent34c43f9f66b33c402947be5e84544e09cb048290 (diff)
downloadSMAPI-e548a4ea9bf24c28ebc024e12af73cd14b76f05f.tar.gz
SMAPI-e548a4ea9bf24c28ebc024e12af73cd14b76f05f.tar.bz2
SMAPI-e548a4ea9bf24c28ebc024e12af73cd14b76f05f.zip
fix assembly definition resolver not disposing loaded definitions
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs
index 33cd6ebd..91c9e192 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs
@@ -10,7 +10,7 @@ namespace StardewModdingAPI.Framework.ModLoading
** Properties
*********/
/// <summary>The known assemblies.</summary>
- private readonly IDictionary<string, AssemblyDefinition> Loaded = new Dictionary<string, AssemblyDefinition>();
+ private readonly IDictionary<string, AssemblyDefinition> Lookup = new Dictionary<string, AssemblyDefinition>();
/*********
@@ -22,8 +22,9 @@ namespace StardewModdingAPI.Framework.ModLoading
{
foreach (AssemblyDefinition assembly in assemblies)
{
- this.Loaded[assembly.Name.Name] = assembly;
- this.Loaded[assembly.Name.FullName] = assembly;
+ this.RegisterAssembly(assembly);
+ this.Lookup[assembly.Name.Name] = assembly;
+ this.Lookup[assembly.Name.FullName] = assembly;
}
}
@@ -44,8 +45,8 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <param name="name">The assembly's short or full name.</param>
private AssemblyDefinition ResolveName(string name)
{
- return this.Loaded.ContainsKey(name)
- ? this.Loaded[name]
+ return this.Lookup.TryGetValue(name, out AssemblyDefinition match)
+ ? match
: null;
}
}