fix(ux): reset input history on plugin dispose (F10.1)

Static InputHistoryService entries used to survive a plugin reload
because static field state doesn't get cleaned up on its own. The new
Reset() method clears the list and is wired into Plugin.DisposeAsync
alongside the existing pure-memory cleanups, so the next plugin load
starts with an empty history instead of inheriting the previous
session's typed commands.
This commit is contained in:
2026-05-12 13:41:38 +02:00
parent 8d9151c74a
commit b489ac946c
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -41,4 +41,12 @@ public static class InputHistoryService
return null; return null;
return _entries[cursor]; 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();
}
} }
+2
View File
@@ -372,6 +372,8 @@ public sealed class Plugin : IAsyncDalamudPlugin
failure = CaptureFailure(failure, () => Functions?.Dispose()); failure = CaptureFailure(failure, () => Functions?.Dispose());
failure = CaptureFailure(failure, () => Commands?.Dispose()); failure = CaptureFailure(failure, () => Commands?.Dispose());
failure = CaptureFailure(failure, () => EmoteCache.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) if (failure is not null)
ExceptionDispatchInfo.Capture(failure).Throw(); ExceptionDispatchInfo.Capture(failure).Throw();