Fixed crash on texture change
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user