示例#1
0
        /// <summary>
        /// Dispose native resources associated with this request, including the raw image data. Any
        /// <see cref="XRCameraImagePlane"/>s returned by <see cref="GetPlane"/> are invalidated immediately after
        /// calling <c>Dispose</c>.
        /// </summary>
        public void Dispose()
        {
            if (m_CameraSubsystem == null || m_NativeHandle == 0)
            {
                return;
            }

            m_CameraSubsystem.DisposeImage(m_NativeHandle);
            m_NativeHandle    = 0;
            m_CameraSubsystem = null;

#if ENABLE_UNITY_COLLECTIONS_CHECKS
            AtomicSafetyHandle.Release(m_SafetyHandle);
#endif
        }