summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eeze_sensor.c9
-rw-r--r--src/modules/eeze_sensor_fake.c5
-rw-r--r--src/modules/eeze_sensor_tizen.c5
3 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/eeze_sensor.c b/src/lib/eeze_sensor.c
index 7e1f6b2..2b90555 100644
--- a/src/lib/eeze_sensor.c
+++ b/src/lib/eeze_sensor.c
@@ -41,7 +41,7 @@ EAPI Eeze_Sensor_Obj *
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();
@@ -52,7 +52,12 @@ eeze_sensor_obj_get(Eeze_Sensor_Type sensor_type)
{
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;
diff --git a/src/modules/eeze_sensor_fake.c b/src/modules/eeze_sensor_fake.c
index 30ab5cc..a5be287 100644
--- a/src/modules/eeze_sensor_fake.c
+++ b/src/modules/eeze_sensor_fake.c
@@ -168,7 +168,12 @@ sensor_fake_init(void)
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;
}
diff --git a/src/modules/eeze_sensor_tizen.c b/src/modules/eeze_sensor_tizen.c
index ae74f6f..ffcc263 100644
--- a/src/modules/eeze_sensor_tizen.c
+++ b/src/modules/eeze_sensor_tizen.c
@@ -781,9 +781,14 @@ sensor_tizen_init(void)
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;
}