diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerBitField.cs b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerBitField.cs index faba2cbe0a5..5c3522d4f1a 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerBitField.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerBitField.cs @@ -4,7 +4,7 @@ namespace UnityEngine.Rendering.UI { /// - /// DebugUIHandler for Bitfield widget. Require the enum to have a None field set to 0 in it's values. + /// DebugUIHandler for Bitfield widget. Require the enum to have a None field set to 0 in its values. /// public class DebugUIHandlerBitField : DebugUIHandlerWidget { @@ -45,9 +45,11 @@ internal override void SetWidget(DebugUI.Widget widget) } ; + // Destroy the remaining toggles outside of the range of the displayed enum. for (; toggleIndex < toggles.Count; ++toggleIndex) { - toggles[toggleIndex].transform.SetParent(null); + CoreUtils.Destroy(toggles[toggleIndex].gameObject); + toggles[toggleIndex] = null; } } diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ed2d7f24b47..4aeae06592e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -164,6 +164,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed LightCluster debug view for ray tracing. - Fixed issue with RAS build fail when LOD was missing a renderer - Fixed an issue where sometime a docked lookdev could be rendered at zero size and break. +- Fixed an issue where runtime debug window UI would leak game objects. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard