Really free the list with sensor modules when shutting down. No idea how I
dropped that as I found it in one old local version I had. Thanks to Mike
for the notice and valgrind for the tooling.
Also make sure we don't corrupt the list before we can free it.
SVN revision: 77291
eeze_sensor_obj_get(Eeze_Sensor_Type sensor_type)
{
Eina_List *l;
- Eeze_Sensor_Obj *obj;
+ Eeze_Sensor_Obj *obj, *sens;
Eeze_Sensor_Module *module;
module = _highest_priority_module_get();
{
if (obj->type == sensor_type)
{
- return obj;
+ sens = calloc(1, sizeof(Eeze_Sensor_Obj));
+ if (!sens) return NULL;
+
+ memcpy(sens, obj, sizeof(Eeze_Sensor_Obj));
+
+ return sens;
}
}
return NULL;
void
sensor_fake_shutdown(void)
{
+ Eeze_Sensor_Obj *sens;
+
eeze_sensor_module_unregister("fake");
+ EINA_LIST_FREE(esensor_module->sensor_list, sens)
+ free(sens);
+
free(esensor_module);
esensor_module = NULL;
}
void
sensor_tizen_shutdown(void)
{
+ Eeze_Sensor_Obj *sens;
+
sensor_stop(sensor_handle, SENSOR_MOTION_FACEDOWN);
sensor_stop(sensor_handle, SENSOR_MOTION_DOUBLETAP);
eeze_sensor_module_unregister("tizen");
+ EINA_LIST_FREE(esensor_module->sensor_list, sens)
+ free(sens);
+
free(esensor_module);
esensor_module = NULL;
}