ecore_con: avoid potential crash during shutdown due to Ecore_Event queue.

This commit is contained in:
Cedric BAIL 2017-03-09 16:10:00 -08:00
parent b80cfb38a1
commit deb6f0d2cd
2 changed files with 19 additions and 0 deletions

View File

@ -218,6 +218,20 @@ ecore_con_legacy_shutdown(void)
EINA_LIST_FREE(_ecore_con_lookups, lookup_ctx)
ecore_thread_cancel(lookup_ctx->thread);
ecore_event_type_flush(ECORE_CON_EVENT_CLIENT_ADD,
ECORE_CON_EVENT_CLIENT_DEL,
ECORE_CON_EVENT_SERVER_ADD,
ECORE_CON_EVENT_SERVER_DEL,
ECORE_CON_EVENT_CLIENT_DATA,
ECORE_CON_EVENT_SERVER_DATA,
ECORE_CON_EVENT_CLIENT_WRITE,
ECORE_CON_EVENT_SERVER_WRITE,
ECORE_CON_EVENT_CLIENT_ERROR,
ECORE_CON_EVENT_SERVER_ERROR,
ECORE_CON_EVENT_PROXY_BIND,
ECORE_CON_EVENT_SERVER_UPGRADE,
ECORE_CON_EVENT_CLIENT_UPGRADE);
ecore_con_socks_shutdown();
if (!_ecore_con_event_count) ecore_con_mempool_shutdown();
else WRN("%d events still exist, leaking ecore_con mempools", _ecore_con_event_count);

View File

@ -73,6 +73,11 @@ ecore_con_url_shutdown(void)
if (_init_count) return _init_count;
EINA_LIST_FREE(_url_con_url_list, url_con_url)
ecore_con_url_free(url_con_url);
ecore_event_type_flush(ECORE_CON_EVENT_URL_DATA,
ECORE_CON_EVENT_URL_COMPLETE,
ECORE_CON_EVENT_URL_PROGRESS);
_c_shutdown();
emile_shutdown(); /* no emile_cipher_shutdown(), handled here */
ecore_con_shutdown();