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
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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Add comment