Search Issue Tracker

Fixed

Fixed in 1.14.1

Votes

0

Found in [Package]

1.14.0

Issue ID

ISXB-1573

Regression

Yes

InputSystemUIInputModule causes a memory leak when it is disabled and then re-enabled during runtime

Package: Input System

-

Reproduction steps:
1. Open the attached “IN-105276.zip” project
2. Open the “SampleScene”
3. Enter Play mode
4. From the Hierarchy, select the “EventSystem” GameObject
5. In the Inspector, disable the “Input System UI Input Module” Component
6. Open the “InputSystemUIInputModule.cs” script in an IDE (VS or Rider)
7. Set a Breakpoint on line 1768 (“if (referenceState.refCount - 1 == 0 && referenceState.enabledByInputModule)")
8. Attach the IDE to Unity Editor
9. Start debugging
10. In the Editor, enable the same “Input System UI Input Module” Component and disable it
11. Observe the IDE variables once the Breakpoint is hit

Expected result: “refCount” value is 1
Actual result: “refCount” value is 2

Reproducible with: 1.13.0, 1.14.0 (2022.3.63f1, 6000.0.51f1, 6000.1.8f1, 6000.2.0b5)
Not reproducible with: 1.12.0 (2022.3.63f1, 6000.0.51f1, 6000.1.8f1, 6000.2.0b5)

Reproducible on: macOS 15.5 (M1 Max) (user reported), Windows 11
Not reproducible on: No other environment tested

Note:
- This happens because after the module is disabled, all the actions are set to none. When the module is enabled, AssignDefaultActions and EnableAllActions are both called, and refCount is added to 2

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.