Skip to content
Snippets Groups Projects
Commit 94a4310c authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

fix segfault in bullet cleanup routine

parent d323f4c1
No related branches found
No related tags found
No related merge requests found
...@@ -195,7 +195,9 @@ namespace fggl::phys::bullet { ...@@ -195,7 +195,9 @@ namespace fggl::phys::bullet {
auto entRB = m_ecs->find<BulletBody>(); auto entRB = m_ecs->find<BulletBody>();
for (const auto& ent : entRB) { for (const auto& ent : entRB) {
auto& bulletBody = m_ecs->get<BulletBody>(ent); auto& bulletBody = m_ecs->get<BulletBody>(ent);
m_world->removeCollisionObject(bulletBody.body); if ( bulletBody.body != nullptr ) {
m_world->removeCollisionObject(bulletBody.body);
}
// release resources and delete // release resources and delete
bulletBody.release(); bulletBody.release();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment