EPhysics: on velocity example unregister callback on restart

Unregister callback on restart and avoid trying to use an to be deleted
body.


SVN revision: 81401
This commit is contained in:
Leandro Dorileo 2012-12-19 20:07:43 +00:00
parent 19a52f4efd
commit 1bcae8fdd4
1 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,9 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
{
Velocity_Data *velocity_data = data;
elm_object_event_callback_del(velocity_data->base.win, _on_keydown,
velocity_data->body);
DBG("Restart pressed");
test_clean((Test_Data *)velocity_data);
_world_populate(velocity_data);
@ -135,6 +138,9 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
velocity_data->old_vy = 0;
velocity_data->old_vaz = 0;
velocity_data->last_time = 0;
elm_object_event_callback_add(velocity_data->base.win, _on_keydown,
velocity_data->body);
}
static void