I’m getting “Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak”. I thought adding the .WithDisposeOnCompletion(…) was enough. Anyone else ran into this issue yet?
NativeArray<D_Occupancy> otherOccupants = GetEntityQuery(ComponentType.ReadOnly<D_Occupancy>()).ToComponentDataArray<D_Occupancy>(Allocator.TempJob);
Entities
.WithReadOnly(otherOccupants)
.ForEach((Entity thisEntity, DynamicBuffer<B_Proximity> myProximityBuffer, in D_Occupancy myOccupantData) =>
{
myProximityBuffer.Clear();
int i = 0;
while (i < otherOccupants.Length)
{
if (!(otherOccupants[i].entityId == thisEntity))
{
if (otherOccupants[i].QuadrantKey == myOccupantData.QuadrantKey)
{
myProximityBuffer.Add(otherOccupants[i].entityId);
}
}
i++;
}
})
.WithDisposeOnCompletion(otherOccupants)
.Schedule();