internal void DestroyInstance()
        {
            EndExclusiveEntityTransaction();

            m_ComponentJobSafetyManager->PreDisposeCheck();

            m_UniversalQuery.Dispose();
            m_UniversalQuery = null;

            m_UniversalQueryWithChunks.Dispose();
            m_UniversalQueryWithChunks = null;

            m_ComponentJobSafetyManager->Dispose();
            UnsafeUtility.Free(m_ComponentJobSafetyManager, Allocator.Persistent);
            m_ComponentJobSafetyManager = null;

            Entities.EntityComponentStore.Destroy(m_EntityComponentStore);

            m_EntityComponentStore = null;
            m_EntityQueryManager.Dispose();
            m_EntityQueryManager = null;
            m_ExclusiveEntityTransaction.OnDestroy();

            m_ManagedComponentStore.Dispose();

            m_World = null;
            m_Debug = null;
        }
Exemplo n.º 2
0
        internal void DestroyInstance()
        {
            PreDisposeCheck();

            #if ENABLE_UNITY_COLLECTIONS_CHECKS
            m_UniversalQuery._DisallowDisposing           = null;
            m_UniversalQueryWithChunks._DisallowDisposing = null;
            #endif
            m_UniversalQuery.Dispose();
            m_UniversalQueryWithChunks.Dispose();
            m_UniversalQuery           = null;
            m_UniversalQueryWithChunks = null;

            m_DependencyManager->Dispose();
            UnsafeUtility.Free(m_DependencyManager, Allocator.Persistent);
            m_DependencyManager = null;

            Entities.EntityComponentStore.Destroy(m_EntityComponentStore);
            m_EntityComponentStore = null;

            Entities.EntityQueryManager.Destroy(m_EntityQueryManager);
            m_EntityQueryManager = null;

            m_EntityQueryManager = null;
            m_ExclusiveEntityTransaction.OnDestroy();

            m_ManagedComponentStore.Dispose();

            m_World = null;
            m_Debug = null;
        }