Search Unity

Missing dispose in Unity.Physics.Hybrid

Discussion in 'Physics for ECS' started by pbhogan, Mar 17, 2022.

  1. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    384
    This is probably not the best way to get this to the attention of the Unity team, but I noticed what seems like a missing

    tmpVertices.Dispose();

    in Unity.Physics.Hybrid/Components/PhysicsShapeAuthoring.cs around line 514, for method AppendMeshPropertiesToNativeBuffers()
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    var tmpVertices = new NativeArray<Vector3>(meshData[0].vertexCount, Allocator.Temp);

    It's Temp allocated, it doesn't need a dispose
     
  3. pbhogan

    pbhogan

    Joined:
    Aug 17, 2012
    Posts:
    384
    Huh... interesting. Somehow, I've deftly avoided coming across this fact and neurotically disposed everything. Maybe they should mention it somewhere in the documentation. Thanks for the enlightenment. :)