Skip to content

Clear the tracked process after killing it - #776

Merged
SimonCropp merged 2 commits into
mainfrom
fix-tray-disposed-process-after-failed-accept
Aug 21, 2026
Merged

Clear the tracked process after killing it#776
SimonCropp merged 2 commits into
mainfrom
fix-tray-disposed-process-after-failed-accept

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

KillProcesses disposes the diff tool's Process and left the reference on the TrackedMove. That is fine when the accept succeeds, because the entry goes; the problem is that it often does not. InnerMove kills first and then tries the move, and a locked target, the user choosing Ignore, or the eight retries running out all re-add the very same object to the dictionary.

The entry is then pending with a disposed Process on it, and two paths read that property: the Accept-open hot key, which filters on Process is { HasExited: false }, and "Open diff tool" via DiffToolLauncher. Both throw InvalidOperationException, "No process is associated with this object", on the UI thread — where nothing is hooked to Application.ThreadException, so the tray takes the exception dialog.

Null the property after disposing, which is what DiffToolLauncher already does in the same situation.

KillProcesses disposes the diff tool's Process and left the reference on the
TrackedMove. That is fine when the accept succeeds, because the entry goes; the
problem is that it often does not. InnerMove kills first and then tries the
move, and a locked target, the user choosing Ignore, or the eight retries
running out all re-add the very same object to the dictionary.

The entry is then pending with a disposed Process on it, and two paths read that
property: the Accept-open hot key, which filters on Process is { HasExited:
false }, and "Open diff tool" via DiffToolLauncher. Both throw
InvalidOperationException, "No process is associated with this object", on the
UI thread — where nothing is hooked to Application.ThreadException, so the tray
takes the exception dialog.

Null the property after disposing, which is what DiffToolLauncher already does
in the same situation.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 21, 2026
@SimonCropp
SimonCropp merged commit d7f8a27 into main Aug 21, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-tray-disposed-process-after-failed-accept branch August 21, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant