private static void OnSessionEnd() { MyManagers.OnUnloadData(); MyActorFactory.RemoveAll(); // many-to-one relation, can live withput owners, deallocated separately // MyComponentFactory<MyInstancingComponent>.RemoveAll(); //MyVoxelMesh.RemoveAll(); //MyDynamicMesh.RemoveAll(); MyRender11.Log.WriteLine("Unloading session data"); // Remove leftover persistent debug draw messages m_debugDrawMessages.Clear(); MyScene.Clear(); MyClipmapFactory.RemoveAll(); MyClipmap.UnloadCache(); MyInstancing.OnSessionEnd(); MyFoliageComponents.OnSessionEnd(); MyMeshes.OnSessionEnd(); MyLights.OnSessionEnd(); MyMaterials1.OnSessionEnd(); MyVoxelMaterials1.OnSessionEnd(); MyMeshMaterials1.OnSessionEnd(); MyScreenDecals.OnSessionEnd(); MyBigMeshTable.Table.OnSessionEnd(); MyPrimitivesRenderer.Unload(); MyTransparentRendering.OnSessionEnd(); MyBillboardRenderer.OnSessionEnd(); //MyAssetsLoader.ClearMeshes(); }