06-05-2024, 08:28 PM
I recently ran into this exception when upgrading my project to Unity 2022.3. In case it matters (for reproducing the exception), in my project the ObiRope objects are within a second scene which is loaded after launch.
Before I found this thread I addressed it by adding the following condition checks within the #if ENABLE_UNITY_COLLECTIONS_CHECKS. Both were necessary.
Before I found this thread I addressed it by adding the following condition checks within the #if ENABLE_UNITY_COLLECTIONS_CHECKS. Both were necessary.
Code:
if (!AtomicSafetyHandle.IsDefaultValue(m_SafetyHandle) && AtomicSafetyHandle.IsHandleValid(m_SafetyHandle))
{
// dispose of atomic safety handle:
AtomicSafetyHandle.CheckDeallocateAndThrow(m_SafetyHandle);
AtomicSafetyHandle.Release(m_SafetyHandle);
}