From a9a35b61d5adc842deb2bb7da9331e17d56e6f69 Mon Sep 17 00:00:00 2001 From: GePrasetyo Date: Fri, 13 Feb 2026 15:45:49 +0100 Subject: [PATCH] Spatial Controller Memory Leak 1. locations were never freed. 2. every PollController call, everything inside inside accessory pointer never freed. --- .../Native/SpatialController/Extensions.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plug-ins/Apple.SpatialController/Native/SpatialController/Extensions.swift b/plug-ins/Apple.SpatialController/Native/SpatialController/Extensions.swift index 0f7b1143..55547c2c 100644 --- a/plug-ins/Apple.SpatialController/Native/SpatialController/Extensions.swift +++ b/plug-ins/Apple.SpatialController/Native/SpatialController/Extensions.swift @@ -481,6 +481,7 @@ extension SCAccessory { usdzFile = nil description.deallocate() description = nil + locations.deallocate() source.deallocate() } } @@ -727,6 +728,8 @@ extension SCControllerState { input.deallocate() anchors.deallocate() if accessory != nil { + var a = accessory.pointee + a.deallocate() accessory.deallocate() accessory = nil }