diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-12 23:46:32 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-12 23:46:32 -0500 |
commit | ff94a8149ed5a0f597500bfb2b1896bdb2f1fff3 (patch) | |
tree | 2bf3d84448229e3a2858939b8dd253521f7b1f64 | |
parent | e4a7ca5826ae0cb372aec529c4f21a53c98079da (diff) | |
download | SMAPI-ff94a8149ed5a0f597500bfb2b1896bdb2f1fff3.tar.gz SMAPI-ff94a8149ed5a0f597500bfb2b1896bdb2f1fff3.tar.bz2 SMAPI-ff94a8149ed5a0f597500bfb2b1896bdb2f1fff3.zip |
fix assets not being disposed when a content manager is disposed
-rw-r--r-- | src/SMAPI/Framework/Content/ContentCache.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/BaseContentManager.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/Content/ContentCache.cs b/src/SMAPI/Framework/Content/ContentCache.cs index 4178b663..c252b7b6 100644 --- a/src/SMAPI/Framework/Content/ContentCache.cs +++ b/src/SMAPI/Framework/Content/ContentCache.cs @@ -119,7 +119,7 @@ namespace StardewModdingAPI.Framework.Content /// <param name="predicate">Matches the asset keys to invalidate.</param> /// <param name="dispose">Whether to dispose invalidated assets. This should only be <c>true</c> when they're being invalidated as part of a dispose, to avoid crashing the game.</param> /// <returns>Returns the removed keys (if any).</returns> - public IEnumerable<string> Remove(Func<string, Type, bool> predicate, bool dispose = false) + public IEnumerable<string> Remove(Func<string, Type, bool> predicate, bool dispose) { List<string> removed = new List<string>(); foreach (string key in this.Cache.Keys.ToArray()) diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs index 5283340e..93fd729b 100644 --- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs @@ -200,7 +200,7 @@ namespace StardewModdingAPI.Framework.ContentManagers return true; } return false; - }); + }, dispose); return removeAssetNames.Select(p => Tuple.Create(p.Key, p.Value)); } |