public void Dispose() { // Move all chunks to become pooled chunks while (m_LastArchetype != null) { while (!m_LastArchetype->ChunkList.IsEmpty) { var chunk = (Chunk *)m_LastArchetype->ChunkList.Begin; SetChunkCount(chunk, 0); } m_LastArchetype->FreeChunksBySharedComponents.Dispose(); m_LastArchetype = m_LastArchetype->PrevArchetype; } // And all pooled chunks while (!m_EmptyChunkPool->IsEmpty) { var chunk = m_EmptyChunkPool->Begin; chunk->Remove(); UnsafeUtility.Free(chunk, Allocator.Persistent); } m_ManagedArrays = null; m_TypeLookup.Dispose(); m_ArchetypeChunkAllocator.Dispose(); }
public void Dispose() { // Free all allocated chunks for all allocated archetypes while (m_LastArchetype != null) { while (!m_LastArchetype->ChunkList.IsEmpty) { var chunk = m_LastArchetype->ChunkList.Begin; chunk->Remove(); UnsafeUtility.Free(chunk, Allocator.Persistent); } m_LastArchetype = m_LastArchetype->PrevArchetype; } // And all pooled chunks while (!m_EmptyChunkPool->IsEmpty) { var chunk = m_EmptyChunkPool->Begin; chunk->Remove(); UnsafeUtility.Free(chunk, Allocator.Persistent); } m_TypeLookup.Dispose(); m_ArchetypeChunkAllocator.Dispose(); }
public void Dispose() { //@TODO: Need to wait for all job handles to be completed.. m_GroupLookup.Dispose(); m_GroupDataChunkAllocator.Dispose(); }
public void Dispose() { m_EntityGroupDataCache.Dispose(); for (var g = m_EntityGroupDatas.Length - 1; g >= 0; --g) { m_EntityGroupDatas.Ptr[g]->Dispose(); } m_EntityGroupDatas.Dispose(); //@TODO: Need to wait for all job handles to be completed.. m_GroupDataChunkAllocator.Dispose(); }