Skip to content

FIX: [Port] [ISX-3179] Fixed Input Device Debugger window staying subscribed after closing - #2510

Open
josepmariapujol-unity wants to merge 1 commit into
developfrom
backport/input/isx-3183-device-debugger-playmode-unsubscribe
Open

josepmariapujol-unity wants to merge 1 commit into
developfrom
backport/input/isx-3183-device-debugger-playmode-unsubscribe

Conversation

@josepmariapujol-unity

Copy link
Copy Markdown
Collaborator

Port of trunk PR #140581

Description

Fixes ISX-3179 (port ticket ISX-3183): InputDeviceDebuggerWindow.OnDestroy subscribed to EditorApplication.playModeStateChanged (+=) instead of unsubscribing (-=).

Each closed Input Device Debugger window stayed referenced by the static event and kept receiving Play mode changes until the next domain reload. With domain reload disabled in Enter Play Mode settings, closed windows built up. Nothing visible broke, because Repaint() does nothing on a destroyed window, so the effect was a managed memory leak.

The fix changes += to -= in OnDestroy.

Testing status & QA

Found by reading the code. No new test: the only effect is that closed windows are no longer kept alive by the event.

QA: open Window > Analysis > Input Debugger, double-click a device to open its debugger window, close it, then enter and exit Play mode. With a breakpoint in OnPlayModeChange, it should no longer be hit for the closed window.

Overall Product Risks

  • Complexity: Low. One-line change in an Editor-only debugging window.
  • Halo Effect: Low. Only affects windows that have already been closed.

Comments to reviewers

The port merged into develop with no conflicts; the code change is identical to trunk. This PR is a draft until the trunk PR lands.

Description written by Claude Code (Claude Opus 5.5) on behalf of the author.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

…scribed after closing

InputDeviceDebuggerWindow.OnDestroy subscribed to EditorApplication.playModeStateChanged
instead of unsubscribing, so closed windows stayed referenced by the event until the next
domain reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@josepmariapujol-unity josepmariapujol-unity self-assigned this Nov 20, 2026
@josepmariapujol-unity
josepmariapujol-unity marked this pull request as ready for review November 20, 2026 08:55

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Ship it

The change correctly pairs the Play mode event subscription with unsubscription when the debugger window closes. I examined initialization, teardown, Play mode callbacks, and the changelog entry; no actionable issues were found.

Reviewed commit 86eec90

🤖 Helpful? 👍/👎

@codecov-github-com

codecov-github-com Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ystem/Editor/Debugger/InputDeviceDebuggerWindow.cs 0.00% 1 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2510      +/-   ##
===========================================
+ Coverage    78.96%   79.22%   +0.25%     
===========================================
  Files          767      769       +2     
  Lines       140949   141283     +334     
===========================================
+ Hits        111305   111926     +621     
+ Misses       29644    29357     -287     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.0_project 77.90% <0.00%> (+0.38%) ⬆️
inputsystem_MacOS_6000.3 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.3_project 77.89% <0.00%> (+0.39%) ⬆️
inputsystem_MacOS_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.6_project 77.96% <0.00%> (+0.39%) ⬆️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.0_project 77.81% <0.00%> (+0.38%) ⬆️
inputsystem_Ubuntu_6000.3 5.32% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.3_project 77.80% <0.00%> (+0.38%) ⬆️
inputsystem_Ubuntu_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.6_project 77.86% <0.00%> (+0.38%) ⬆️
inputsystem_Windows_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.0_project 78.02% <0.00%> (+0.38%) ⬆️
inputsystem_Windows_6000.3 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.3_project 78.01% <0.00%> (+0.38%) ⬆️
inputsystem_Windows_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.6_project 78.08% <0.00%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ystem/Editor/Debugger/InputDeviceDebuggerWindow.cs 0.27% <0.00%> (ø)

... and 13 files with indirect coverage changes

ℹ️ Need help interpreting these results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant