diff --git a/HellionChat/InputHistoryService.cs b/HellionChat/InputHistoryService.cs index d7d9300..833cc5c 100644 --- a/HellionChat/InputHistoryService.cs +++ b/HellionChat/InputHistoryService.cs @@ -41,4 +41,12 @@ public static class InputHistoryService return null; return _entries[cursor]; } + + // Plugin reload doesn't reset static state automatically. Plugin.DisposeAsync + // calls this so the next load starts with an empty history instead of + // inheriting the previous session's entries. + public static void Reset() + { + _entries.Clear(); + } } diff --git a/HellionChat/Plugin.cs b/HellionChat/Plugin.cs index b3a8e5e..f92652b 100755 --- a/HellionChat/Plugin.cs +++ b/HellionChat/Plugin.cs @@ -372,6 +372,8 @@ public sealed class Plugin : IAsyncDalamudPlugin failure = CaptureFailure(failure, () => Functions?.Dispose()); failure = CaptureFailure(failure, () => Commands?.Dispose()); failure = CaptureFailure(failure, () => EmoteCache.Dispose()); + // Static input history would otherwise survive the plugin reload. + failure = CaptureFailure(failure, InputHistoryService.Reset); if (failure is not null) ExceptionDispatchInfo.Capture(failure).Throw();