summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/examples/test_velocity.c
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-19 20:07:43 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-19 20:07:43 +0000
commit1bcae8fdd4a2395cd26f61010a9fe21ae477224a (patch)
treebf91f7e1445eaa587cef117081774e5bd3282db5 /legacy/ephysics/src/examples/test_velocity.c
parent19a52f4efd4e457f5c0f13ec58dd0601ea23a17d (diff)
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
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/examples/test_velocity.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/legacy/ephysics/src/examples/test_velocity.c b/legacy/ephysics/src/examples/test_velocity.c
index 0ae8372005..785767bff1 100644
--- a/legacy/ephysics/src/examples/test_velocity.c
+++ b/legacy/ephysics/src/examples/test_velocity.c
@@ -128,6 +128,9 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
128{ 128{
129 Velocity_Data *velocity_data = data; 129 Velocity_Data *velocity_data = data;
130 130
131 elm_object_event_callback_del(velocity_data->base.win, _on_keydown,
132 velocity_data->body);
133
131 DBG("Restart pressed"); 134 DBG("Restart pressed");
132 test_clean((Test_Data *)velocity_data); 135 test_clean((Test_Data *)velocity_data);
133 _world_populate(velocity_data); 136 _world_populate(velocity_data);
@@ -135,6 +138,9 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
135 velocity_data->old_vy = 0; 138 velocity_data->old_vy = 0;
136 velocity_data->old_vaz = 0; 139 velocity_data->old_vaz = 0;
137 velocity_data->last_time = 0; 140 velocity_data->last_time = 0;
141
142 elm_object_event_callback_add(velocity_data->base.win, _on_keydown,
143 velocity_data->body);
138} 144}
139 145
140static void 146static void