internal void DestroyInstance() { EndExclusiveEntityTransaction(); m_ComponentJobSafetyManager->PreDisposeCheck(); m_UniversalQuery.Dispose(); m_UniversalQuery = null; m_ComponentJobSafetyManager->Dispose(); UnsafeUtility.Free(m_ComponentJobSafetyManager, Allocator.Persistent); m_ComponentJobSafetyManager = null; Entities.EntityComponentStore.Destroy(m_EntityComponentStore); m_EntityComponentStore = null; m_EntityGroupManager.Dispose(); m_EntityGroupManager = null; m_ExclusiveEntityTransaction.OnDestroy(); m_ManagedComponentStore.Dispose(); m_World = null; m_Debug = null; TypeManager.Shutdown(); }
protected override void OnDestroyManager() { EndExclusiveEntityTransaction(); ComponentJobSafetyManager.Dispose(); ComponentJobSafetyManager = null; m_Entities->OnDestroy(); UnsafeUtility.Free(m_Entities, Allocator.Persistent); m_Entities = null; m_ArchetypeManager.Dispose(); m_ArchetypeManager = null; m_GroupManager.Dispose(); m_GroupManager = null; m_ExclusiveEntityTransaction.OnDestroyManager(); m_SharedComponentManager.Dispose(); UnsafeUtility.Free(m_CachedComponentTypeArray, Allocator.Persistent); m_CachedComponentTypeArray = null; UnsafeUtility.Free(m_CachedComponentTypeInArchetypeArray, Allocator.Persistent); m_CachedComponentTypeInArchetypeArray = null; }