summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-19 20:08:05 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-19 20:08:05 +0000
commit661d8344519d62cc6e9344a07722331b00e6dfde (patch)
treea18edc836f882402b765658997880330f2a6fde7
parent0c3429078b736b1eeadfa08e9e4bff4f13517c4d (diff)
ephysics_test: unregister callback on restart
Unregister callback on restart and avoid trying to use an to be deleted body. SVN revision: 81402
-rw-r--r--src/bin/test_velocity.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/test_velocity.c b/src/bin/test_velocity.c
index 0ae8372..785767b 100644
--- a/src/bin/test_velocity.c
+++ b/src/bin/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