summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:16:45 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commitaef1ee96e854cc0e4991559c9346288c5cd82c38 (patch)
tree82686ab46351caeb412a72386047e2ee4c221c8a
parent168d2a14460918f8b658add7e5d71807bd24ee19 (diff)
downloadefl-aef1ee96e854cc0e4991559c9346288c5cd82c38.tar.gz
eio: avoid crash during shutdown due to Ecore_Event queue.
-rw-r--r--src/lib/eio/eio_monitor.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c
index 5c4eb8fbb1..ccc13c4339 100644
--- a/src/lib/eio/eio_monitor.c
+++ b/src/lib/eio/eio_monitor.c
@@ -140,17 +140,20 @@ _eio_monitor_error_cb(void *data, Eio_File *handler EINA_UNUSED, int error)
void
eio_monitor_init(void)
{
- EIO_MONITOR_ERROR = ecore_event_type_new();
- EIO_MONITOR_SELF_RENAME = ecore_event_type_new();
- EIO_MONITOR_SELF_DELETED = ecore_event_type_new();
- EIO_MONITOR_FILE_CREATED = ecore_event_type_new();
- EIO_MONITOR_FILE_DELETED = ecore_event_type_new();
- EIO_MONITOR_FILE_MODIFIED = ecore_event_type_new();
- EIO_MONITOR_FILE_CLOSED = ecore_event_type_new();
- EIO_MONITOR_DIRECTORY_CREATED = ecore_event_type_new();
- EIO_MONITOR_DIRECTORY_DELETED = ecore_event_type_new();
- EIO_MONITOR_DIRECTORY_MODIFIED = ecore_event_type_new();
- EIO_MONITOR_DIRECTORY_CLOSED = ecore_event_type_new();
+ if (EIO_MONITOR_ERROR == 0)
+ {
+ EIO_MONITOR_ERROR = ecore_event_type_new();
+ EIO_MONITOR_SELF_RENAME = ecore_event_type_new();
+ EIO_MONITOR_SELF_DELETED = ecore_event_type_new();
+ EIO_MONITOR_FILE_CREATED = ecore_event_type_new();
+ EIO_MONITOR_FILE_DELETED = ecore_event_type_new();
+ EIO_MONITOR_FILE_MODIFIED = ecore_event_type_new();
+ EIO_MONITOR_FILE_CLOSED = ecore_event_type_new();
+ EIO_MONITOR_DIRECTORY_CREATED = ecore_event_type_new();
+ EIO_MONITOR_DIRECTORY_DELETED = ecore_event_type_new();
+ EIO_MONITOR_DIRECTORY_MODIFIED = ecore_event_type_new();
+ EIO_MONITOR_DIRECTORY_CLOSED = ecore_event_type_new();
+ }
eio_monitor_backend_init();
eio_monitor_fallback_init();
@@ -168,6 +171,18 @@ eio_monitor_shutdown(void)
Eina_Iterator *it;
Eio_Monitor *monitor;
+ ecore_event_type_flush(EIO_MONITOR_ERROR,
+ EIO_MONITOR_SELF_RENAME,
+ EIO_MONITOR_SELF_DELETED,
+ EIO_MONITOR_FILE_CREATED,
+ EIO_MONITOR_FILE_DELETED,
+ EIO_MONITOR_FILE_MODIFIED,
+ EIO_MONITOR_FILE_CLOSED,
+ EIO_MONITOR_DIRECTORY_CREATED,
+ EIO_MONITOR_DIRECTORY_DELETED,
+ EIO_MONITOR_DIRECTORY_MODIFIED,
+ EIO_MONITOR_DIRECTORY_CLOSED);
+
it = eina_hash_iterator_data_new(_eio_monitors);
EINA_ITERATOR_FOREACH(it, monitor)
{