Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    375
    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,543
    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:
    375
    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. :)