EPhysics: test delete body, fix bodies list mess.
authorLeandro Dorileo <dorileo@profusion.mobi>
Tue, 30 Oct 2012 18:31:21 +0000 (18:31 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Tue, 30 Oct 2012 18:31:21 +0000 (18:31 +0000)
Patch by: Leandro Dorileo <dorileo@profusion.mobi>

SVN revision: 78677

legacy/ephysics/src/bin/test_delete.c

index 958f5aaf59ee0d77ec718a6fa0a44d4e40baae08..086386ed3e99affe010bb9e2521e4fc141c5ab5a 100644 (file)
@@ -29,8 +29,6 @@ _del_cb(void *data, EPhysics_Body *body, void *event_info __UNUSED__)
    evas_object_del(shadow);
    evas_object_del(obj);
 
-   collision_data->base.bodies = eina_list_remove(collision_data->base.bodies,
-                                                  body);
    collision_data->sphere = NULL;
 }
 
@@ -44,6 +42,9 @@ _collision_cb(void *data, EPhysics_Body *body, void *event_info)
    contact_body = ephysics_body_collision_contact_body_get(collision);
    if (contact_body != collision_data->sphere2) return;
 
+   collision_data->base.bodies = eina_list_remove(collision_data->base.bodies,
+                                                  body);
+
    INF("Collision Detected");
    ephysics_body_del(body);
 }