From e6c696fa6b0bfe5ef013e1179765ce1dcb071c38 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 19 Apr 2022 19:11:58 -0400 Subject: add immutable stack trace to cache stack info --- src/SMAPI/Framework/Deprecations/DeprecationManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/Deprecations/DeprecationManager.cs') diff --git a/src/SMAPI/Framework/Deprecations/DeprecationManager.cs b/src/SMAPI/Framework/Deprecations/DeprecationManager.cs index da17ce7e..84ce2132 100644 --- a/src/SMAPI/Framework/Deprecations/DeprecationManager.cs +++ b/src/SMAPI/Framework/Deprecations/DeprecationManager.cs @@ -63,7 +63,7 @@ namespace StardewModdingAPI.Framework.Deprecations return; // queue warning - var stack = new StackTrace(skipFrames: 1); // skip this method + ImmutableStackTrace stack = ImmutableStackTrace.Get(skipFrames: 1); this.QueuedWarnings.Add(new DeprecationWarning(source, nounPhrase, version, severity, stack)); } @@ -134,7 +134,7 @@ namespace StardewModdingAPI.Framework.Deprecations /// Get the simplest stack trace which shows where in the mod the deprecated code was called from. /// The stack trace. /// The mod for which to show a stack trace. - private string GetSimplifiedStackTrace(StackTrace stack, IModMetadata? mod) + private string GetSimplifiedStackTrace(ImmutableStackTrace stack, IModMetadata? mod) { // unknown mod, show entire stack trace if (mod == null) -- cgit