summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:15:54 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commitff3c6f394eb5a944da75a5cc001a664fc4dfee69 (patch)
tree6b243818dfc1b176cffe0ff07b54e9ac097ab41e /src/lib/eeze
parent4eeb4e8706305002a20b96ca83bc935bb1a4c3d9 (diff)
eeze: avoid crash during shutdown due to Ecore_Event queue.
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_disk_mount.c4
-rw-r--r--src/lib/eeze/eeze_sensor.c105
2 files changed, 48 insertions, 61 deletions
diff --git a/src/lib/eeze/eeze_disk_mount.c b/src/lib/eeze/eeze_disk_mount.c
index ed151d04be..56b8fa9186 100644
--- a/src/lib/eeze/eeze_disk_mount.c
+++ b/src/lib/eeze/eeze_disk_mount.c
@@ -186,6 +186,10 @@ eeze_mount_init(void)
186void 186void
187eeze_mount_shutdown(void) 187eeze_mount_shutdown(void)
188{ 188{
189 ecore_event_type_flush(EEZE_EVENT_DISK_MOUNT,
190 EEZE_EVENT_DISK_UNMOUNT,
191 EEZE_EVENT_DISK_EJECT,
192 EEZE_EVENT_DISK_ERROR);
189 eeze_libmount_shutdown(); 193 eeze_libmount_shutdown();
190 ecore_event_handler_del(_mount_handler); 194 ecore_event_handler_del(_mount_handler);
191 _mount_handler = NULL; 195 _mount_handler = NULL;
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index 284f7885e6..17027a75e6 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -335,6 +335,27 @@ eeze_sensor_async_read(Eeze_Sensor_Obj *sens, void *user_data)
335void 335void
336eeze_sensor_shutdown(void) 336eeze_sensor_shutdown(void)
337{ 337{
338 ecore_event_type_flush(EEZE_SENSOR_EVENT_ACCELEROMETER,
339 EEZE_SENSOR_EVENT_GRAVITY,
340 EEZE_SENSOR_EVENT_LINEAR_ACCELERATION,
341 EEZE_SENSOR_EVENT_DEVICE_ORIENTATION,
342 EEZE_SENSOR_EVENT_MAGNETIC,
343 EEZE_SENSOR_EVENT_ORIENTATION,
344 EEZE_SENSOR_EVENT_GYROSCOPE,
345 EEZE_SENSOR_EVENT_LIGHT,
346 EEZE_SENSOR_EVENT_PROXIMITY,
347 EEZE_SENSOR_EVENT_SNAP,
348 EEZE_SENSOR_EVENT_SHAKE,
349 EEZE_SENSOR_EVENT_DOUBLETAP,
350 EEZE_SENSOR_EVENT_PANNING,
351 EEZE_SENSOR_EVENT_PANNING_BROWSE,
352 EEZE_SENSOR_EVENT_TILT,
353 EEZE_SENSOR_EVENT_FACEDOWN,
354 EEZE_SENSOR_EVENT_DIRECT_CALL,
355 EEZE_SENSOR_EVENT_SMART_ALERT,
356 EEZE_SENSOR_EVENT_NO_MOVE,
357 EEZE_SENSOR_EVENT_BAROMETER,
358 EEZE_SENSOR_EVENT_TEMPERATURE);
338 eeze_sensor_modules_unload(); 359 eeze_sensor_modules_unload();
339 eina_hash_free(g_handle->modules); 360 eina_hash_free(g_handle->modules);
340 g_handle->modules = NULL; 361 g_handle->modules = NULL;
@@ -365,67 +386,29 @@ eeze_sensor_init(void)
365 386
366 /* Make sure we create new ecore event types before using them */ 387 /* Make sure we create new ecore event types before using them */
367 if (EEZE_SENSOR_EVENT_ACCELEROMETER == 0) 388 if (EEZE_SENSOR_EVENT_ACCELEROMETER == 0)
368 EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new(); 389 {
369 390 EEZE_SENSOR_EVENT_ACCELEROMETER = ecore_event_type_new();
370 if (EEZE_SENSOR_EVENT_GRAVITY == 0) 391 EEZE_SENSOR_EVENT_GRAVITY = ecore_event_type_new();
371 EEZE_SENSOR_EVENT_GRAVITY = ecore_event_type_new(); 392 EEZE_SENSOR_EVENT_LINEAR_ACCELERATION = ecore_event_type_new();
372 393 EEZE_SENSOR_EVENT_DEVICE_ORIENTATION = ecore_event_type_new();
373 if (EEZE_SENSOR_EVENT_LINEAR_ACCELERATION == 0) 394 EEZE_SENSOR_EVENT_MAGNETIC = ecore_event_type_new();
374 EEZE_SENSOR_EVENT_LINEAR_ACCELERATION = ecore_event_type_new(); 395 EEZE_SENSOR_EVENT_ORIENTATION = ecore_event_type_new();
375 396 EEZE_SENSOR_EVENT_GYROSCOPE = ecore_event_type_new();
376 if (EEZE_SENSOR_EVENT_DEVICE_ORIENTATION == 0) 397 EEZE_SENSOR_EVENT_LIGHT = ecore_event_type_new();
377 EEZE_SENSOR_EVENT_DEVICE_ORIENTATION = ecore_event_type_new(); 398 EEZE_SENSOR_EVENT_PROXIMITY = ecore_event_type_new();
378 399 EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new();
379 if (EEZE_SENSOR_EVENT_MAGNETIC == 0) 400 EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new();
380 EEZE_SENSOR_EVENT_MAGNETIC = ecore_event_type_new(); 401 EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new();
381 402 EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new();
382 if (EEZE_SENSOR_EVENT_ORIENTATION == 0) 403 EEZE_SENSOR_EVENT_PANNING_BROWSE = ecore_event_type_new();
383 EEZE_SENSOR_EVENT_ORIENTATION = ecore_event_type_new(); 404 EEZE_SENSOR_EVENT_TILT = ecore_event_type_new();
384 405 EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new();
385 if (EEZE_SENSOR_EVENT_GYROSCOPE == 0) 406 EEZE_SENSOR_EVENT_DIRECT_CALL = ecore_event_type_new();
386 EEZE_SENSOR_EVENT_GYROSCOPE = ecore_event_type_new(); 407 EEZE_SENSOR_EVENT_SMART_ALERT = ecore_event_type_new();
387 408 EEZE_SENSOR_EVENT_NO_MOVE = ecore_event_type_new();
388 if (EEZE_SENSOR_EVENT_LIGHT == 0) 409 EEZE_SENSOR_EVENT_BAROMETER = ecore_event_type_new();
389 EEZE_SENSOR_EVENT_LIGHT = ecore_event_type_new(); 410 EEZE_SENSOR_EVENT_TEMPERATURE = ecore_event_type_new();
390 411 }
391 if (EEZE_SENSOR_EVENT_PROXIMITY == 0)
392 EEZE_SENSOR_EVENT_PROXIMITY = ecore_event_type_new();
393
394 if (EEZE_SENSOR_EVENT_SNAP == 0)
395 EEZE_SENSOR_EVENT_SNAP = ecore_event_type_new();
396
397 if (EEZE_SENSOR_EVENT_SHAKE == 0)
398 EEZE_SENSOR_EVENT_SHAKE = ecore_event_type_new();
399
400 if (EEZE_SENSOR_EVENT_DOUBLETAP == 0)
401 EEZE_SENSOR_EVENT_DOUBLETAP = ecore_event_type_new();
402
403 if (EEZE_SENSOR_EVENT_PANNING == 0)
404 EEZE_SENSOR_EVENT_PANNING = ecore_event_type_new();
405
406 if (EEZE_SENSOR_EVENT_PANNING_BROWSE == 0)
407 EEZE_SENSOR_EVENT_PANNING_BROWSE = ecore_event_type_new();
408
409 if (EEZE_SENSOR_EVENT_TILT == 0)
410 EEZE_SENSOR_EVENT_TILT = ecore_event_type_new();
411
412 if (EEZE_SENSOR_EVENT_FACEDOWN == 0)
413 EEZE_SENSOR_EVENT_FACEDOWN = ecore_event_type_new();
414
415 if (EEZE_SENSOR_EVENT_DIRECT_CALL == 0)
416 EEZE_SENSOR_EVENT_DIRECT_CALL = ecore_event_type_new();
417
418 if (EEZE_SENSOR_EVENT_SMART_ALERT == 0)
419 EEZE_SENSOR_EVENT_SMART_ALERT = ecore_event_type_new();
420
421 if (EEZE_SENSOR_EVENT_NO_MOVE == 0)
422 EEZE_SENSOR_EVENT_NO_MOVE = ecore_event_type_new();
423
424 if (EEZE_SENSOR_EVENT_BAROMETER == 0)
425 EEZE_SENSOR_EVENT_BAROMETER = ecore_event_type_new();
426
427 if (EEZE_SENSOR_EVENT_TEMPERATURE == 0)
428 EEZE_SENSOR_EVENT_TEMPERATURE = ecore_event_type_new();
429 412
430 /* Core is ready so we can load the modules from disk now */ 413 /* Core is ready so we can load the modules from disk now */
431 eeze_sensor_modules_load(); 414 eeze_sensor_modules_load();