Skip to content

Commit 3be5f70

Browse files
author
Alexander Seeck
committed
only detach children when calling Destroy
1 parent 5aec5dd commit 3be5f70

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Assets/MixedRealityToolkit.Services/BoundarySystem/MixedRealityBoundarySystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ public override void Destroy()
8181
// and clean up the parent.
8282
if (boundaryVisualizationParent != null)
8383
{
84-
boundaryVisualizationParent.transform.DetachChildren();
8584

8685
if (Application.isEditor)
8786
{
8887
Object.DestroyImmediate(boundaryVisualizationParent);
8988
}
9089
else
9190
{
91+
boundaryVisualizationParent.transform.DetachChildren();
9292
Object.Destroy(boundaryVisualizationParent);
9393
}
9494

Assets/MixedRealityToolkit.Services/DiagnosticsSystem/MixedRealityDiagnosticsSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public override void Destroy()
6262
{
6363
if (diagnosticVisualizationParent != null)
6464
{
65-
diagnosticVisualizationParent.transform.DetachChildren();
6665
if (Application.isEditor)
6766
{
6867
Object.DestroyImmediate(diagnosticVisualizationParent);
6968
}
7069
else
7170
{
71+
diagnosticVisualizationParent.transform.DetachChildren();
7272
Object.Destroy(diagnosticVisualizationParent);
7373
}
7474

Assets/MixedRealityToolkit.Services/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ public override void Destroy()
8383
// Detach the child objects and clean up the parent.
8484
if (spatialAwarenessObjectParent != null)
8585
{
86-
spatialAwarenessObjectParent.transform.DetachChildren();
8786
if (Application.isEditor)
8887
{
8988
Object.DestroyImmediate(spatialAwarenessObjectParent);
9089
}
9190
else
9291
{
92+
spatialAwarenessObjectParent.transform.DetachChildren();
9393
Object.Destroy(spatialAwarenessObjectParent);
9494
}
9595
spatialAwarenessObjectParent = null;

0 commit comments

Comments
 (0)