cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=93b63b48e862c1ee5c217abeede05a5533c96ed7
commit 93b63b48e862c1ee5c217abeede05a5533c96ed7 Author: Cedric BAIL <ced...@osg.samsung.com> Date: Thu Mar 9 16:16:56 2017 -0800 elementary: avoid crash during shutdown due to Ecore_Event queue. --- src/lib/elementary/elm_config.c | 2 ++ src/lib/elementary/elm_main.c | 14 +++++++++----- src/lib/elementary/elm_sys_notify.c | 7 +++++-- src/lib/elementary/elm_systray.c | 2 ++ src/lib/elementary/elm_thumb.c | 6 ++++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 269c5d3..3510ba1 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -3785,6 +3785,8 @@ _elm_config_init(void) void _elm_config_sub_shutdown(void) { + ecore_event_type_flush(ELM_EVENT_CONFIG_ALL_CHANGED); + #ifdef HAVE_ELEMENTARY_X if (ecore_x_display_get()) ecore_x_shutdown(); #endif diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index 60514bc..42bca8c 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -672,11 +672,11 @@ elm_quicklaunch_init(int argc, memset(_elm_policies, 0, sizeof(_elm_policies)); if (!ELM_EVENT_POLICY_CHANGED) - ELM_EVENT_POLICY_CHANGED = ecore_event_type_new(); - if (!ELM_EVENT_PROCESS_BACKGROUND) - ELM_EVENT_PROCESS_BACKGROUND = ecore_event_type_new(); - if (!ELM_EVENT_PROCESS_FOREGROUND) - ELM_EVENT_PROCESS_FOREGROUND = ecore_event_type_new(); + { + ELM_EVENT_POLICY_CHANGED = ecore_event_type_new(); + ELM_EVENT_PROCESS_BACKGROUND = ecore_event_type_new(); + ELM_EVENT_PROCESS_FOREGROUND = ecore_event_type_new(); + } if (!ecore_file_init()) ERR("Elementary cannot init ecore_file"); @@ -780,6 +780,10 @@ elm_quicklaunch_shutdown(void) eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_SHUTDOWN); + ecore_event_type_flush(ELM_EVENT_POLICY_CHANGED, + ELM_EVENT_PROCESS_BACKGROUND, + ELM_EVENT_PROCESS_FOREGROUND); + if (pfx) eina_prefix_free(pfx); pfx = NULL; ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del); diff --git a/src/lib/elementary/elm_sys_notify.c b/src/lib/elementary/elm_sys_notify.c index 0b35972..c7a2dcb 100644 --- a/src/lib/elementary/elm_sys_notify.c +++ b/src/lib/elementary/elm_sys_notify.c @@ -208,8 +208,11 @@ _elm_sys_notify_singleton_get(Eo *obj EINA_UNUSED, EOLIAN static void _elm_sys_notify_class_constructor(Efl_Class *klass EINA_UNUSED) { - ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = ecore_event_type_new(); - ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = ecore_event_type_new(); + if (ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED == 0) + { + ELM_EVENT_SYS_NOTIFY_NOTIFICATION_CLOSED = ecore_event_type_new(); + ELM_EVENT_SYS_NOTIFY_ACTION_INVOKED = ecore_event_type_new(); + } } /*============================================================================* diff --git a/src/lib/elementary/elm_systray.c b/src/lib/elementary/elm_systray.c index 45ca469..d815824 100644 --- a/src/lib/elementary/elm_systray.c +++ b/src/lib/elementary/elm_systray.c @@ -491,6 +491,8 @@ _elm_unneed_systray(void) { if (!_elm_need_systray) return; + ecore_event_type_flush(ELM_EVENT_SYSTRAY_READY); + _elm_need_systray = EINA_FALSE; eldbus_service_interface_unregister(_iface); diff --git a/src/lib/elementary/elm_thumb.c b/src/lib/elementary/elm_thumb.c index 205a033..e6e5084 100644 --- a/src/lib/elementary/elm_thumb.c +++ b/src/lib/elementary/elm_thumb.c @@ -500,7 +500,8 @@ _elm_unneed_ethumb(void) _elm_ethumb_client = NULL; } ethumb_client_shutdown(); - ELM_ECORE_EVENT_ETHUMB_CONNECT = 0; + + ecore_event_type_flush(ELM_ECORE_EVENT_ETHUMB_CONNECT); } static Eina_Bool @@ -519,7 +520,8 @@ elm_need_ethumb(void) if (_elm_need_ethumb) return EINA_TRUE; _elm_need_ethumb = EINA_TRUE; - ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new(); + if (ELM_ECORE_EVENT_ETHUMB_CONNECT == 0) + ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new(); ethumb_client_init(); return EINA_TRUE; --