Search Issue Tracker

Duplicate

Votes

0

Found in [Package]

10.1.0

Issue ID

1290211

Regression

No

[HDRP] CustomPass memory leak on interaction with CustomPass in inspector

Package: Scriptable Render Pipeline HD

-

Reproduction steps:
1. Open attached project "HDRPCustomPassLeak.zip" and scene "CustomPass"
2. In Hierarchy window, select "VM_CustomPass" GameObject
3. In Inspector window, "Custom Pass Volume (Script)" component, interact with the Dummy Slider
4. Observe Console window
5. Enter Play Mode and repeat steps 2-4

Expected Result: If a new object is about to be called with Setup, Cleanup should be called on the destroyed object.
Actual Result: Cleanup is not called for old CustomPasses when new CustomPasses are being Setup

Reproducible with: 7.5.1 (2019.4.14f1), 9.0.0-preview.71 (2020.1.13f1), 10.1.0 (2020.2.0b11)
Could not test with: 2018.4.29f1 (console errors break project), 2021.1.0a5 (Setup and Cleanup are called only after entering/exiting Play Mode)

  1. Resolution Note:

    Duplicate of issue 1193322 (custom passes are using serializeReference internally which was causing this issue).
    The issue is fixed in Unity 2021.1.0a5 and above and a backport is planned for 2020.2, 2020.1 and 2019.4. You can follow the original issue here:
    https://issuetracker.unity3d.com/issues/serializereference-non-serialized-initialized-fields-lose-their-values-when-entering-play-mode

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.