summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/physic_object.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/physic_object.c b/src/bin/physic_object.c
index 1f365e5..387768a 100644
--- a/src/bin/physic_object.c
+++ b/src/bin/physic_object.c
@@ -520,7 +520,10 @@ void physic_object_del(PhysicObject *pobj)
520 evas_object_del(obj); 520 evas_object_del(obj);
521 521
522 //remove body 522 //remove body
523 cpSpaceRemoveBody(space, pobj->body); 523 // But don't try to remove static bodies, since they're not
524 // added to space (otherwise they would be simulated).
525 if (!pobj->static_body)
526 cpSpaceRemoveBody(space, pobj->body);
524 cpBodyFree(pobj->body); 527 cpBodyFree(pobj->body);
525 528
526 physic_objects = eina_list_remove(physic_objects, pobj); 529 physic_objects = eina_list_remove(physic_objects, pobj);