elementary: avoid crash during shutdown due to Ecore_Event queue.

This commit is contained in:
Cedric BAIL 2017-03-09 16:16:56 -08:00
parent aef1ee96e8
commit 93b63b48e8
5 changed files with 22 additions and 9 deletions

View File

@ -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

View File

@ -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);

View File

@ -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();
}
}
/*============================================================================*

View File

@ -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);

View File

@ -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;