Fixed crash on texture change

This commit is contained in:
2026-04-04 05:36:08 +03:00
parent b8c61da1f7
commit 07101fcc64

View File

@@ -83,9 +83,16 @@ EditorApp::~EditorApp()
// Delete all editor entities before OGRE cleanup
// This ensures all components with Ogre resources are cleaned up while SceneManager exists
// Collect entities first, then delete after iteration (can't modify during iteration)
std::vector<flecs::entity> entitiesToDelete;
m_world.query<EditorMarkerComponent>().each([&](flecs::entity e, EditorMarkerComponent) {
e.destruct();
entitiesToDelete.push_back(e);
});
for (auto& e : entitiesToDelete) {
if (e.is_alive()) {
e.destruct();
}
}
// Release all systems
m_proceduralMeshSystem.reset();