summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 11:14:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-19 11:14:37 +0900
commitff24ac2d6ddaafba49ae5100f17fe37e5d874140 (patch)
treeb98881dd9ccb98896bbc8784a91e6b61a7403b41 /src/lib/eeze
parent47bf356435d7b4562e64f45ef59dbf190dff16c7 (diff)
efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would become invalid, since they are now stored in a dynamic array rather than a statically stored array. The risk here is that if a module of EFL tends to init/shutdown in a "normal" scenario then the event type array will grow in a leaking manner. This could be fixed by resetting those event ID's only when the loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using EFL_EVENT_DEL in this patch as this would add too many event callbacks to the main loop object, which may result in slightly slower event calls to it, affecting the overall performance.
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_sensor.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index 17027a75e6..9705cfb4f1 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -385,30 +385,27 @@ eeze_sensor_init(void)
385 if (!g_handle->modules) return EINA_FALSE; 385 if (!g_handle->modules) return EINA_FALSE;
386 386
387 /* Make sure we create new ecore event types before using them */ 387 /* Make sure we create new ecore event types before using them */
388 if (EEZE_SENSOR_EVENT_ACCELEROMETER == 0) 388 EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new();
389 { 389 EEZE_SENSOR_EVENT_GRAVITY = ecore_event_type_new();
390 EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new(); 390 EEZE_SENSOR_EVENT_LINEAR_ACCELERATION = ecore_event_type_new();
391 EEZE_SENSOR_EVENT_GRAVITY = ecore_event_type_new(); 391 EEZE_SENSOR_EVENT_DEVICE_ORIENTATION = ecore_event_type_new();
392 EEZE_SENSOR_EVENT_LINEAR_ACCELERATION = ecore_event_type_new(); 392 EEZE_SENSOR_EVENT_MAGNETIC = ecore_event_type_new();
393 EEZE_SENSOR_EVENT_DEVICE_ORIENTATION = ecore_event_type_new(); 393 EEZE_SENSOR_EVENT_ORIENTATION = ecore_event_type_new();
394 EEZE_SENSOR_EVENT_MAGNETIC = ecore_event_type_new(); 394 EEZE_SENSOR_EVENT_GYROSCOPE = ecore_event_type_new();
395 EEZE_SENSOR_EVENT_ORIENTATION = ecore_event_type_new(); 395 EEZE_SENSOR_EVENT_LIGHT = ecore_event_type_new();
396 EEZE_SENSOR_EVENT_GYROSCOPE = ecore_event_type_new(); 396 EEZE_SENSOR_EVENT_PROXIMITY = ecore_event_type_new();
397 EEZE_SENSOR_EVENT_LIGHT = ecore_event_type_new(); 397 EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new();
398 EEZE_SENSOR_EVENT_PROXIMITY = ecore_event_type_new(); 398 EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new();
399 EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new(); 399 EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new();
400 EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new(); 400 EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new();
401 EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new(); 401 EEZE_SENSOR_EVENT_PANNING_BROWSE = ecore_event_type_new();
402 EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new(); 402 EEZE_SENSOR_EVENT_TILT = ecore_event_type_new();
403 EEZE_SENSOR_EVENT_PANNING_BROWSE = ecore_event_type_new(); 403 EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new();
404 EEZE_SENSOR_EVENT_TILT = ecore_event_type_new(); 404 EEZE_SENSOR_EVENT_DIRECT_CALL = ecore_event_type_new();
405 EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new(); 405 EEZE_SENSOR_EVENT_SMART_ALERT = ecore_event_type_new();
406 EEZE_SENSOR_EVENT_DIRECT_CALL = ecore_event_type_new(); 406 EEZE_SENSOR_EVENT_NO_MOVE = ecore_event_type_new();
407 EEZE_SENSOR_EVENT_SMART_ALERT = ecore_event_type_new(); 407 EEZE_SENSOR_EVENT_BAROMETER = ecore_event_type_new();
408 EEZE_SENSOR_EVENT_NO_MOVE = ecore_event_type_new(); 408 EEZE_SENSOR_EVENT_TEMPERATURE = ecore_event_type_new();
409 EEZE_SENSOR_EVENT_BAROMETER = ecore_event_type_new();
410 EEZE_SENSOR_EVENT_TEMPERATURE = ecore_event_type_new();
411 }
412 409
413 /* Core is ready so we can load the modules from disk now */ 410 /* Core is ready so we can load the modules from disk now */
414 eeze_sensor_modules_load(); 411 eeze_sensor_modules_load();