diff --git a/.github/workflows/pr_labeler.yaml b/.github/workflows/pr_labeler.yaml index 4dbb0ea6a..9a3c67832 100644 --- a/.github/workflows/pr_labeler.yaml +++ b/.github/workflows/pr_labeler.yaml @@ -11,7 +11,7 @@ jobs: label-pr: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v8 with: script: | if (context.payload.pull_request.base.ref == 'feature/XRI3') diff --git a/.github/workflows/validation_mrtk3.yaml b/.github/workflows/validation_mrtk3.yaml index dc88c0a65..2f7e1f9c3 100644 --- a/.github/workflows/validation_mrtk3.yaml +++ b/.github/workflows/validation_mrtk3.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Get Pull Request changes if: github.event_name == 'pull_request' diff --git a/org.mixedrealitytoolkit.input/InteractionModes/InteractionModeManager.cs b/org.mixedrealitytoolkit.input/InteractionModes/InteractionModeManager.cs index b80b0723d..13381d3db 100644 --- a/org.mixedrealitytoolkit.input/InteractionModes/InteractionModeManager.cs +++ b/org.mixedrealitytoolkit.input/InteractionModes/InteractionModeManager.cs @@ -298,6 +298,17 @@ private void Awake() InitializeInteractionModeDetectors(); } + /// + /// A Unity event function that is called when the script component has been destroyed. + /// + private void OnDestroy() + { + if (InteractionManager != null) + { + InteractionManager.interactorRegistered -= OnInteractorRegistered; + } + } + /// /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector. /// diff --git a/org.mixedrealitytoolkit.spatialmanipulation/BoundsControl/BoundsCalculator.cs b/org.mixedrealitytoolkit.spatialmanipulation/BoundsControl/BoundsCalculator.cs index f23d1eed2..10e1b700a 100644 --- a/org.mixedrealitytoolkit.spatialmanipulation/BoundsControl/BoundsCalculator.cs +++ b/org.mixedrealitytoolkit.spatialmanipulation/BoundsControl/BoundsCalculator.cs @@ -100,6 +100,8 @@ internal static Bounds CalculateBounds( finalBounds.Encapsulate(root.InverseTransformPoint(totalBoundsCorners[i])); } + totalBoundsCorners.Clear(); + childTransforms.Clear(); // Avoid keeping reference to Unity objects to avoid "Leaked Memory Shell" return finalBounds; } diff --git a/org.mixedrealitytoolkit.uxcore/Interop/UGUIInputAdapter.cs b/org.mixedrealitytoolkit.uxcore/Interop/UGUIInputAdapter.cs index c6a87369c..ecd6517c7 100644 --- a/org.mixedrealitytoolkit.uxcore/Interop/UGUIInputAdapter.cs +++ b/org.mixedrealitytoolkit.uxcore/Interop/UGUIInputAdapter.cs @@ -162,6 +162,19 @@ protected override void OnDisable() } } + /// + /// A Unity event function that is called when the script component has been destroyed. + /// + protected override void OnDestroy() + { + base.OnDestroy(); + if (InteractionManager != null) + { + InteractionManager.interactorRegistered -= OnInteractorRegistered; + InteractionManager.interactorUnregistered -= OnInteractorUnregistered; + } + } + /// /// Called when a an is registered with a Unity . ///