Dispose the current step in Plugin.Stop#11
Merged
redstrate merged 1 commit intoMay 1, 2026
Conversation
When the user clicks "Close" on the End step, Plugin.Stop() sets CurrentStep to null without calling Dispose on it first. EndStep owns an EmbedIO WebServer bound to localhost:42073 (started in Run, torn down in Dispose), so the server keeps listening on the port for the rest of the game session and the step's resources leak. Other steps that subscribe to events in their constructor (e.g. PlaytimeStep, which hooks ChatGui.ChatMessage) leak in the same way if Stop is called before they complete naturally. Call CurrentStep?.Dispose() before nulling the field so the step releases what it owns.
redstrate
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the user clicks Close on the End step,
Plugin.Stop()setsCurrentStepto null without callingDispose()on it first:EndStepowns an EmbedIOWebServerbound tohttp://localhost:42073/— started inRun, torn down inDispose. With Stop bypassing Dispose, the server keeps listening on 42073 for the rest of the game session and the step's resources leak. The same shape of leak applies to any other step that subscribes to events in its constructor:PlaytimeStepfor instance hooksChatGui.ChatMessagein.ctorand unhooks it inDispose.I noticed this while clicking Close after the export finished — the window dismissed, but
ss -tlnpstill showed the EmbedIO listener attached to ffxiv_dx11.exe.Change
Call
CurrentStep?.Dispose()before nulling the field. One-line change.NextStep()already disposes the step on the natural end-of-pipeline path (_stepIndex >= _steps.Count), so this just makes theStop()codepath behave consistently.Testing
After the change, clicking Close on the End step shuts the EmbedIO listener down (verified — port 42073 no longer in
ss -tlnpoutput). No behavioral change to the success path.